#!/usr/bin/env bash
# -u intentionally omitted: the auto-detect block references optional env vars
# (LEOSIS_SKILLS_DIR, CLAUDE_SKILLS_DIR, HERMES_SKILLS_DIR, CURSOR_RULES_DIR,
# OPENCODE_DIR, CODEX_HOME) — failing on unset values breaks installer UX.
# -o pipefail kept: ensures the heredoc chain surfaces real failures.
set -eo pipefail

# ───────────────────────────────────────────────────────────────────────
# USB installer
# pack:    universal-skill-bridge-catalog v0.4.1
# target:  auto
# skills:  529
# verify:  https://usb.peepsicklabs.com/api/install-sha256?target=auto
# Inspect with: less install.sh   |   Run with: bash install.sh
# Dry-run:  bash install.sh --check   (lists actions, executes nothing)
# ───────────────────────────────────────────────────────────────────────

# --- output helpers (also used by the auto-detect block below) ---
RED=$'[0;31m'
GRN=$'[0;32m'
YEL=$'[0;33m'
CYA=$'[0;36m'
DIM=$'[2m'
RST=$'[0m'

# --- --check / --dry-run flag: show what would happen, run nothing ---
USB_CHECK=0
case "${1:-}" in
  --check|--dry-run)
    USB_CHECK=1
    shift
    printf '
%s[check]%s dry-run mode — listing actions, executing nothing.

' "$CYA" "$RST"
    ;;
esac

# Run a command, or print "[would] <cmd>" in check mode.
do_or_show() {
  if [ "$USB_CHECK" = "1" ]; then
    printf '  %s[would]%s %s
' "$DIM" "$RST" "$*"
  else
    "$@"
  fi
}

# Write stdin to a file, or just announce it in check mode.
# Redirections can't go through do_or_show: the shell would open/truncate
# the file before the function runs, so dry-run must consume stdin itself.
write_file() {
  if [ "$USB_CHECK" = "1" ]; then
    cat > /dev/null
    printf '  %s[would]%s write %s
' "$DIM" "$RST" "$1"
  else
    cat > "$1"
  fi
}

REQUESTED_TARGET="auto"
TARGET="$REQUESTED_TARGET"
PACK_SLUG="universal-skill-bridge-catalog"
PACK_VERSION="0.4.1"
SKILL_COUNT="529"
ROOT="${AI_SKILL_HOME:-$HOME/.ai-skills}"
PACK_DIR="$ROOT/$PACK_SLUG"

if [ "$TARGET" = "auto" ]; then
  # Detect every supported runtime. We collect ALL hits so the user can pick
  # when more than one is installed — silently picking the first is bad UX.
  __USB_DETECTED=()
  [ -n "$LEOSIS_SKILLS_DIR" ] || [ -d "$HOME/.leosis" ]    && __USB_DETECTED+=("leosis")
  [ -n "$CLAUDE_SKILLS_DIR" ] || [ -d "$HOME/.claude" ]    && __USB_DETECTED+=("claude")
  [ -n "$HERMES_SKILLS_DIR" ] || [ -d "$HOME/.hermes" ]    && __USB_DETECTED+=("hermes")
  [ -n "$CURSOR_RULES_DIR" ] || [ -d "$HOME/.cursor" ]    && __USB_DETECTED+=("cursor")
  [ -n "$OPENCODE_DIR" ]      || [ -d "$HOME/.opencode" ] && __USB_DETECTED+=("opencode")
  [ -n "$CODEX_HOME" ]        || [ -d "$HOME/.codex" ]    && __USB_DETECTED+=("openai")
  [ -d "$HOME/.continue" ]                                  && __USB_DETECTED+=("langchain")
  [ -d "$HOME/.aider" ]                                     && __USB_DETECTED+=("anthropic")
  [ -d "$HOME/.vllm" ]                                      && __USB_DETECTED+=("vllm")
  [ -d "$HOME/.ollama" ]                                    && __USB_DETECTED+=("ollama")
  [ -d "$HOME/.lmstudio" ]                                  && __USB_DETECTED+=("lm-studio")
  [ -d "$HOME/.openrouter" ]                                && __USB_DETECTED+=("openrouter")
  [ -d "$HOME/.groq" ]                                      && __USB_DETECTED+=("groq")
  [ -d "$HOME/.mistral" ]                                   && __USB_DETECTED+=("mistral")
  [ -d "$HOME/.mcp" ]                                       && __USB_DETECTED+=("mcp")

  __USB_DETECT_COUNT=${#__USB_DETECTED[@]}
  if [ "$__USB_DETECT_COUNT" -eq 0 ]; then
    TARGET="generic"
    printf '%s[!]%s No AI runtime detected — falling back to generic.
' "$YEL" "$RST"
  elif [ "$__USB_DETECT_COUNT" -eq 1 ]; then
    TARGET="${__USB_DETECTED[0]}"
    printf '%s[OK]%s Auto-detected runtime: %s%s%s
' "$GRN" "$RST" "$CYA" "$TARGET" "$RST"
  else
    printf '
%s  Multiple AI runtimes detected on this machine:%s
' "$CYA" "$RST"
    printf '  %s
' "${__USB_DETECTED[*]}"

    # Where the answer is read from matters. Under `curl ... | bash` — the
    # documented one-liner, and what the CLI itself used to do — stdin is the
    # pipe carrying this script's own remaining text, not the keyboard. A bare
    # `select` there eats those leftover script lines as answers, prints
    # "Invalid choice" once per line, and never waits for the user. The real
    # terminal is /dev/tty, so prefer that whenever stdin isn't already one.
    __USB_INPUT=""
    if [ -t 0 ]; then
      __USB_INPUT="/dev/stdin"
    elif [ -r /dev/tty ] && (exec < /dev/tty) 2>/dev/null; then
      __USB_INPUT="/dev/tty"
    fi

    if [ -z "$__USB_INPUT" ]; then
      # Truly non-interactive (CI, no tty). Never loop — pick and say so.
      TARGET="${__USB_DETECTED[0]}"
      printf '%s[!]%s No terminal attached — defaulting to %s%s%s.
' "$YEL" "$RST" "$CYA" "$TARGET" "$RST"
      printf '    Pass --target=<name> or set USB_TARGET=<name> to choose explicitly.
'
    else
      __USB_OPTIONS=("${__USB_DETECTED[@]}" "generic (custom path)" "Cancel")
      PS3=$'
  Which one should USB install into? (number): '
      select __USB_CHOICE in "${__USB_OPTIONS[@]}"; do
        # Windows terminals deliver Enter as CRLF, leaving a trailing \r in
        # REPLY. select resolves the option before we can strip it, so on a
        # miss re-resolve by index from the stripped REPLY.
        REPLY="${REPLY%$'\r'}"
        if [ -z "$__USB_CHOICE" ]; then
          case "$REPLY" in
            ''|*[!0-9]*) ;;
            *) __USB_CHOICE="${__USB_OPTIONS[$((REPLY-1))]:-}" ;;
          esac
        fi
        if [ -z "$__USB_CHOICE" ]; then
          printf '%s[!]%s Invalid choice.
' "$YEL" "$RST"
          continue
        fi
        if [ "$__USB_CHOICE" = "Cancel" ]; then
          printf '%s[x]%s Cancelled.
' "$RED" "$RST"
          exit 1
        fi
        if [ "$__USB_CHOICE" = "generic (custom path)" ]; then
          TARGET="generic"
        else
          TARGET="$__USB_CHOICE"
        fi
        printf '%s[OK]%s Selected: %s%s%s
' "$GRN" "$RST" "$CYA" "$TARGET" "$RST"
        break
      done < "$__USB_INPUT"

      # select leaves its loop on EOF (Ctrl-D) without ever assigning TARGET.
      if [ "$TARGET" = "auto" ]; then
        TARGET="${__USB_DETECTED[0]}"
        printf '
%s[!]%s No selection made — defaulting to %s%s%s.
' "$YEL" "$RST" "$CYA" "$TARGET" "$RST"
      fi
    fi
  fi
  unset __USB_DETECTED __USB_DETECT_COUNT __USB_CHOICE __USB_OPTIONS __USB_INPUT
fi

do_or_show mkdir -p "$PACK_DIR/skills" "$ROOT/adapters/$TARGET"

write_file "$PACK_DIR/skillpack.json" <<'__USB_SKILLPACK_JSON_DE117FFB3CF890BE__'
{
  "schemaVersion": "skill-bridge/v1",
  "generatedAt": "2026-06-18T19:55:31.156Z",
  "source": "https://usb.peepsicklabs.com",
  "installCommand": "curl -fsSL \"https://usb.peepsicklabs.com/api/install?target=auto\" | bash",
  "target": "auto",
  "adapter": {
    "files": [
      {
        "kind": "manifest",
        "path": "skillpack.json",
        "description": "Portable manifest containing all skills and adapter metadata."
      },
      {
        "kind": "skill",
        "path": "skills/*.md",
        "description": "Markdown skill files readable by any agent runtime."
      }
    ],
    "label": "Auto-detect Bridge",
    "notes": "Auto-detects the active agent runtime on your machine. LeoSIS folders are checked first, then Claude, Hermes, Cursor, LangChain, and finally falls back to generic markdown + JSON manifest when no known runtime is found.",
    "target": "auto",
    "commandHint": "curl -fsSL <host>/api/install?target=auto | bash",
    "installPath": "$AI_SKILL_HOME or $HOME/.ai-skills",
    "capabilities": [
      "runtime detection",
      "manifest sync",
      "portable markdown skills",
      "LeoSIS-first preference"
    ]
  },
  "pack": {
    "slug": "universal-skill-bridge-catalog",
    "name": "Universal Skill Bridge Catalog",
    "description": "A fully original, from-scratch catalog across 16 provider targets: 65 hand-researched engineering domains systematically expanded across 8 workflows (Audit, Plan, Build, Script, Diagnose, Harden, Explain, Tune) into 529 skills, plus 9 hand-written core orchestration skills. Every skill has a distinct trigger phrase, protocol prompt, input/output contract and examples — zero external dependencies.",
    "version": "0.4.1",
    "author": "Universal Skill Bridge"
  },
  "adapters": [
    {
      "files": [
        {
          "kind": "manifest",
          "path": "leosis.skillpack.json",
          "description": "LeoSIS-native skill pack manifest with /v1/skills metadata."
        },
        {
          "kind": "skill",
          "path": "skills/<slug>.md",
          "description": "Markdown skill card consumable by LeoSIS skill router."
        },
        {
          "kind": "tool",
          "path": "adapter.bridge.json",
          "description": "OpenAI-compatible tool descriptor for /v1/chat/completions."
        }
      ],
      "label": "LeoSIS Native Bridge",
      "notes": "First-class integration with PeepSick Labs LeoSIS Ultra (useleosis.com). Installs the catalog into the LeoSIS skill directory and exposes it through the LeoSIS Brain router. Works with LeoSis CoWorker, Brain, and AgentOS runtimes out of the box. Recommended default for LeoSIS Ultra deployments.",
      "target": "leosis",
      "commandHint": "curl -fsSL <host>/api/install?target=leosis | bash",
      "installPath": "$LEOSIS_SKILLS_DIR or $HOME/.leosis/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "LeoSIS Ultra native integration",
        "OpenAI-compatible /v1 endpoint",
        "sk-leosis-... key authentication",
        "per-user memory isolation",
        "RAG-augmented tool routing"
      ]
    },
    {
      "files": [
        {
          "kind": "manifest",
          "path": "skillpack.json",
          "description": "Portable manifest containing all skills and adapter metadata."
        },
        {
          "kind": "skill",
          "path": "skills/*.md",
          "description": "Markdown skill files readable by any agent runtime."
        }
      ],
      "label": "Auto-detect Bridge",
      "notes": "Auto-detects the active agent runtime on your machine. LeoSIS folders are checked first, then Claude, Hermes, Cursor, LangChain, and finally falls back to generic markdown + JSON manifest when no known runtime is found.",
      "target": "auto",
      "commandHint": "curl -fsSL <host>/api/install?target=auto | bash",
      "installPath": "$AI_SKILL_HOME or $HOME/.ai-skills",
      "capabilities": [
        "runtime detection",
        "manifest sync",
        "portable markdown skills",
        "LeoSIS-first preference"
      ]
    },
    {
      "files": [
        {
          "kind": "skill",
          "path": "skills/<slug>.md",
          "description": "Claude Code-compatible skill card with trigger phrase and protocol."
        }
      ],
      "label": "Claude-compatible Skills",
      "notes": "Writes prompt, input and output contracts as markdown skill cards into Claude Code's expected folder structure.",
      "target": "claude",
      "commandHint": "curl -fsSL <host>/api/install?target=claude | bash",
      "installPath": "$CLAUDE_SKILLS_DIR or $HOME/.claude/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "SKILL.md style docs",
        "tool contract prompts",
        "verification checklists"
      ]
    },
    {
      "files": [
        {
          "kind": "manifest",
          "path": "hermes.skillpack.json",
          "description": "Hermes adapter target, capabilities and file listing."
        }
      ],
      "label": "Hermes Agent Pack",
      "notes": "Generates Hermes-compatible manifest and markdown protocols for agent orchestration.",
      "target": "hermes",
      "commandHint": "curl -fsSL <host>/api/install?target=hermes | bash",
      "installPath": "$HERMES_SKILLS_DIR or $HOME/.hermes/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "agent graph hints",
        "skill routing",
        "memory summaries"
      ]
    },
    {
      "files": [
        {
          "kind": "tool",
          "path": "openai.tools.json",
          "description": "Tool descriptor list derived from skill input/output contracts."
        }
      ],
      "label": "OpenAI Agents Tool Descriptor",
      "notes": "Converts skill information into OpenAI Agents SDK function/tool descriptor format via manifest generation.",
      "target": "openai",
      "commandHint": "curl -fsSL <host>/api/install?target=openai | bash",
      "installPath": "$AI_SKILL_HOME/adapters/openai",
      "capabilities": [
        "tool descriptors",
        "json inputs",
        "structured outputs"
      ]
    },
    {
      "files": [
        {
          "kind": "tool",
          "path": "anthropic.tools.json",
          "description": "Anthropic Messages API tool_use descriptors."
        },
        {
          "kind": "skill",
          "path": "skills/<slug>.md",
          "description": "Markdown skill cards with prompt-cache breakpoint hints."
        }
      ],
      "label": "Anthropic Messages API",
      "notes": "Targets Anthropic's first-party Messages API (api.anthropic.com) directly without going through Claude Code. Produces tool_use descriptors compatible with Claude 3.5 Sonnet, 3.7 Sonnet, and the 4 family. Honors prompt-cache TTL fields and cache breakpoint placement.",
      "target": "anthropic",
      "commandHint": "curl -fsSL <host>/api/install?target=anthropic | bash",
      "installPath": "$ANTHROPIC_SKILLS_DIR or $HOME/.anthropic/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "direct Messages API tool_use blocks",
        "Claude 3.5/3.7/4 native compatibility",
        "prompt-cache TTL hints",
        "no Claude Code dependency"
      ]
    },
    {
      "files": [
        {
          "kind": "tool",
          "path": "langchain.registry.json",
          "description": "Tool registry and routing hints."
        }
      ],
      "label": "LangChain / LangGraph Adapter",
      "notes": "Drops a ready-made registry JSON for writing a skill router node in LangChain or LangGraph.",
      "target": "langchain",
      "commandHint": "curl -fsSL <host>/api/install?target=langchain | bash",
      "installPath": "$AI_SKILL_HOME/adapters/langchain",
      "capabilities": [
        "tool registry",
        "graph node notes",
        "router metadata"
      ]
    },
    {
      "files": [
        {
          "kind": "rule",
          "path": "universal-skill-bridge-catalog.mdc",
          "description": "Compact skill router rules for IDE agents."
        }
      ],
      "label": "Cursor / IDE Rules",
      "notes": "Summarizes the skill pack into a single IDE rule file, providing behavior to coding agents in a single document.",
      "target": "cursor",
      "commandHint": "curl -fsSL <host>/api/install?target=cursor | bash",
      "installPath": "$CURSOR_RULES_DIR or $HOME/.cursor/rules/universal-skill-bridge-catalog.mdc",
      "capabilities": [
        "project rules",
        "coding checklists",
        "review protocol"
      ]
    },
    {
      "files": [
        {
          "kind": "manifest",
          "path": "mcp.server.json",
          "description": "MCP prompt/resource descriptor draft."
        }
      ],
      "label": "MCP Server Descriptor",
      "notes": "Produces a descriptor for contextualizing MCP server implementation as prompts/resources.",
      "target": "mcp",
      "commandHint": "curl -fsSL <host>/api/install?target=mcp | bash",
      "installPath": "$AI_SKILL_HOME/adapters/mcp",
      "capabilities": [
        "server manifest",
        "resource hints",
        "prompt templates"
      ]
    },
    {
      "files": [
        {
          "kind": "manifest",
          "path": "skillpack.json",
          "description": "Runtime-independent master pack manifest."
        }
      ],
      "label": "Generic Portable Pack",
      "notes": "Creates importable manifest and markdown skill files for any model or agent system that does not match a specific adapter.",
      "target": "generic",
      "commandHint": "curl -fsSL <host>/api/install?target=generic | bash",
      "installPath": "$AI_SKILL_HOME or $HOME/.ai-skills/universal-skill-bridge-catalog",
      "capabilities": [
        "plain manifest",
        "markdown prompts",
        "runtime-agnostic"
      ]
    },
    {
      "files": [
        {
          "kind": "tool",
          "path": "openrouter.tools.json",
          "description": "OpenAI-format tool descriptors routed through OpenRouter."
        },
        {
          "kind": "manifest",
          "path": "skillpack.json",
          "description": "Portable manifest with model routing hints."
        }
      ],
      "label": "OpenRouter Multi-Model Bridge",
      "notes": "Targets OpenRouter (openrouter.ai) which exposes an OpenAI-compatible API for 100+ models. Adapter emits tool descriptors in OpenAI tool format so any OpenRouter-routed model can call the skills. Includes credit-cost hints per skill and free-model fallback annotations.",
      "target": "openrouter",
      "commandHint": "curl -fsSL <host>/api/install?target=openrouter | bash",
      "installPath": "$OPENROUTER_SKILLS_DIR or $HOME/.openrouter/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "OpenAI-compatible /api/v1 endpoint",
        "fallback model routing",
        "credit-based billing passthrough",
        "100+ model manifest"
      ]
    },
    {
      "files": [
        {
          "kind": "tool",
          "path": "groq.tools.json",
          "description": "OpenAI function-call descriptors for Groq inference."
        },
        {
          "kind": "skill",
          "path": "skills/<slug>.md",
          "description": "Markdown skill cards with latency-budget annotations."
        }
      ],
      "label": "Groq Fast Inference Bridge",
      "notes": "Targets GroqCloud (groq.com) — sub-second token streaming via LPU hardware. Adapter emits function-call descriptors in OpenAI format. Best suited for high-throughput RAG and tool-routing scenarios where latency matters more than model size.",
      "target": "groq",
      "commandHint": "curl -fsSL <host>/api/install?target=groq | bash",
      "installPath": "$GROQ_SKILLS_DIR or $HOME/.groq/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "ultra-low-latency LPU inference",
        "OpenAI-compatible endpoint",
        "Llama 3 / Mixtral / Gemma native",
        "batch routing aware"
      ]
    },
    {
      "files": [
        {
          "kind": "tool",
          "path": "mistral.tools.json",
          "description": "Mistral function-calling descriptors."
        },
        {
          "kind": "skill",
          "path": "skills/<slug>.md",
          "description": "Markdown skill cards with model-suitability tags."
        }
      ],
      "label": "Mistral AI API Bridge",
      "notes": "Targets Mistral AI's first-party API (api.mistral.ai). Adapter produces function-calling descriptors compatible with Mistral Large, Codestral, and Mixtral model families. Supports JSON-mode tool outputs and per-model capability hints.",
      "target": "mistral",
      "commandHint": "curl -fsSL <host>/api/install?target=mistral | bash",
      "installPath": "$MISTRAL_SKILLS_DIR or $HOME/.mistral/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "Mistral function-calling",
        "Codestral code-completion aware",
        "OpenAI-compatible endpoint",
        "JSON-mode tool outputs"
      ]
    },
    {
      "files": [
        {
          "kind": "manifest",
          "path": "ollama.modelfile.patch",
          "description": "Patch instructions for Ollama Modelfile."
        },
        {
          "kind": "skill",
          "path": "skills/<slug>.md",
          "description": "Markdown skill cards consumable by Ollama tool-aware models."
        }
      ],
      "label": "Ollama Local Runtime",
      "notes": "Targets Ollama (ollama.com) running locally. Adapter emits Ollama Modelfile patches that teach the local model the skill catalog. Compatible with any Ollama model that supports function calling (llama3.1, qwen2.5, mistral, etc.).",
      "target": "ollama",
      "commandHint": "curl -fsSL <host>/api/install?target=ollama | bash",
      "installPath": "$OLLAMA_SKILLS_DIR or $HOME/.ollama/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "local inference, zero API cost",
        "Modelfile-aware tool support",
        "GPU/CPU autodetect",
        "offline-first skill library"
      ]
    },
    {
      "files": [
        {
          "kind": "tool",
          "path": "lmstudio.tools.json",
          "description": "OpenAI-format tool descriptors for LM Studio's local server."
        },
        {
          "kind": "manifest",
          "path": "preset.json",
          "description": "LM Studio preset configuration patch."
        }
      ],
      "label": "LM Studio Local Desktop",
      "notes": "Targets LM Studio's built-in local server (lmstudio.ai). Emits OpenAI-compatible tool descriptors and patches LM Studio's preset configuration to include the skill catalog. Runs entirely offline; ideal for air-gapped development.",
      "target": "lm-studio",
      "commandHint": "curl -fsSL <host>/api/install?target=lm-studio | bash",
      "installPath": "$LM_STUDIO_SKILLS_DIR or $HOME/.lmstudio/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "GGUF model support",
        "local OpenAI-compatible server",
        "GPU/CPU layer offload aware",
        "no network requirement"
      ]
    },
    {
      "files": [
        {
          "kind": "tool",
          "path": "vllm.tools.json",
          "description": "OpenAI-format tool descriptors for vLLM /v1 endpoint."
        },
        {
          "kind": "skill",
          "path": "skills/<slug>.md",
          "description": "Markdown skill cards with throughput hints."
        }
      ],
      "label": "vLLM Self-Hosted Inference",
      "notes": "Targets self-hosted vLLM inference servers. Adapter emits OpenAI-format tool descriptors compatible with vLLM's /v1/chat/completions endpoint. Suitable for on-prem deployments, large-scale batch processing, and cost-sensitive production workloads.",
      "target": "vllm",
      "commandHint": "curl -fsSL <host>/api/install?target=vllm | bash",
      "installPath": "$VLLM_SKILLS_DIR or $HOME/.vllm/skills/universal-skill-bridge-catalog",
      "capabilities": [
        "PagedAttention high-throughput",
        "OpenAI-compatible server",
        "multi-GPU tensor parallelism",
        "HuggingFace model loader"
      ]
    }
  ],
  "skills": [
    {
      "slug": "a-b-testing-framework-audit",
      "name": "A/B Testing Framework: Audit",
      "category": "Audit",
      "description": "[A/B Testing Framework] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "triggerPhrase": "You need to examine the current \"A/B Testing Framework\" setup without making changes. Look for the specific failure pattern: \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing A/B Testing Framework. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Use the best practice Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle. as your evaluation baseline. Verify your findings with statsmodels sample size calculation + Bayesian A/B test + sequential testing. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current A/B Testing Framework setup\" — produce an inventory of experiment spec / variant assignment / metric definition / statistical analysis script and flag issues related to Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.",
        "\"Check A/B Testing Framework health\" — run statsmodels sample size calculation and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:audit",
          "audit",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a11y-aria-patterns-audit",
      "name": "Accessibility ARIA Patterns: Audit",
      "category": "Audit",
      "description": "[Accessibility ARIA Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "triggerPhrase": "You need to examine the current \"Accessibility ARIA Patterns\" setup without making changes. Look for the specific failure pattern: \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Accessibility ARIA Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Use the best practice Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader. as your evaluation baseline. Verify your findings with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Accessibility ARIA Patterns setup\" — produce an inventory of ARIA attribute refactor / keyboard navigation / focus management / screen reader test script and flag issues related to Adding ARIA attributes that conflict with native HTML semantics (e.",
        "\"Check Accessibility ARIA Patterns health\" — run axe-core and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:audit",
          "audit",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "agent-tool-binding-audit",
      "name": "Agent Tool Binding & Dispatch: Audit",
      "category": "Audit",
      "description": "[Agent Tool Binding & Dispatch] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "triggerPhrase": "You need to examine the current \"Agent Tool Binding & Dispatch\" setup without making changes. Look for the specific failure pattern: \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Agent Tool Binding & Dispatch. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Use the best practice Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step. as your evaluation baseline. Verify your findings with agent trace log + tool invocation frequency analysis + token cost audit. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Agent Tool Binding & Dispatch setup\" — produce an inventory of router tool / domain group / dynamic tool injection / tool usage statistics and flag issues related to Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.",
        "\"Check Agent Tool Binding & Dispatch health\" — run agent trace log and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:agent-tool-binding",
          "workflow:audit",
          "audit",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "analytics-metric-definition-audit",
      "name": "Analytics Metric Definitions: Audit",
      "category": "Audit",
      "description": "[Analytics Metric Definitions] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "triggerPhrase": "You need to examine the current \"Analytics Metric Definitions\" setup without making changes. Look for the specific failure pattern: \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Analytics Metric Definitions. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Use the best practice Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly. as your evaluation baseline. Verify your findings with dbt docs generate + dbt test --select tag:metrics + metric comparison script. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Analytics Metric Definitions setup\" — produce an inventory of metric definition / dbt model / SQL logic / dashboard tile / documentation and flag issues related to Different teams computing the same metric (e.",
        "\"Check Analytics Metric Definitions health\" — run dbt docs generate and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:audit",
          "audit",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "adr-documentation-audit",
      "name": "Architecture Decision Records: Audit",
      "category": "Audit",
      "description": "[Architecture Decision Records] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "triggerPhrase": "You need to examine the current \"Architecture Decision Records\" setup without making changes. Look for the specific failure pattern: \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Architecture Decision Records. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Use the best practice Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences. as your evaluation baseline. Verify your findings with adr-tools list + adr-tools generate + decision log index page. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ADR document / decision log / template / review workflow this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Architecture Decision Records setup\" — produce an inventory of ADR document / decision log / template / review workflow and flag issues related to Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.",
        "\"Check Architecture Decision Records health\" — run adr-tools list and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:adr-documentation",
          "workflow:audit",
          "audit",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "aws-lambda-cold-start-audit",
      "name": "AWS Lambda Cold Starts: Audit",
      "category": "Audit",
      "description": "[AWS Lambda Cold Starts] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "triggerPhrase": "You need to examine the current \"AWS Lambda Cold Starts\" setup without making changes. Look for the specific failure pattern: \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing AWS Lambda Cold Starts. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Use the best practice Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions. as your evaluation baseline. Verify your findings with AWS X-Ray trace + Lambda Insights + cold start dashboard. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current AWS Lambda Cold Starts setup\" — produce an inventory of handler refactor / SnapStart config / Provisioned Concurrency / warmer function and flag issues related to Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.",
        "\"Check AWS Lambda Cold Starts health\" — run AWS X-Ray trace and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:audit",
          "audit",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "azure-bicep-audit",
      "name": "Azure Bicep Infrastructure: Audit",
      "category": "Audit",
      "description": "[Azure Bicep Infrastructure] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "triggerPhrase": "You need to examine the current \"Azure Bicep Infrastructure\" setup without making changes. Look for the specific failure pattern: \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Azure Bicep Infrastructure. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Use the best practice Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic. as your evaluation baseline. Verify your findings with az deployment group validate + az what-if + bicep build. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific main.bicep / module / parameter file / azd template this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Azure Bicep Infrastructure setup\" — produce an inventory of main.bicep / module / parameter file / azd template and flag issues related to Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.",
        "\"Check Azure Bicep Infrastructure health\" — run az deployment group validate and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:azure-bicep",
          "workflow:audit",
          "audit",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "browser-devtools-audit",
      "name": "Browser DevTools & Debugging: Audit",
      "category": "Audit",
      "description": "[Browser DevTools & Debugging] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "triggerPhrase": "You need to examine the current \"Browser DevTools & Debugging\" setup without making changes. Look for the specific failure pattern: \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Browser DevTools & Debugging. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Use the best practice Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM. as your evaluation baseline. Verify your findings with Chrome DevTools performance recording + memory heap snapshot + network throttle. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Browser DevTools & Debugging setup\" — produce an inventory of debugging workflow / breakpoint guide / performance recording / memory snapshot and flag issues related to Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.",
        "\"Check Browser DevTools & Debugging health\" — run Chrome DevTools performance recording and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:browser-devtools",
          "workflow:audit",
          "audit",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cli-tool-design-audit",
      "name": "CLI Tool Design Patterns: Audit",
      "category": "Audit",
      "description": "[CLI Tool Design Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "triggerPhrase": "You need to examine the current \"CLI Tool Design Patterns\" setup without making changes. Look for the specific failure pattern: \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing CLI Tool Design Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Use the best practice Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output. as your evaluation baseline. Verify your findings with echo $? after CLI run + stderr redirection test + --json output validation. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current CLI Tool Design Patterns setup\" — produce an inventory of CLI scaffolding / argument parser / exit code handler / --json output mode and flag issues related to Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.",
        "\"Check CLI Tool Design Patterns health\" — run echo $? after CLI run and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cli-tool-design",
          "workflow:audit",
          "audit",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cloud-cost-optimization-audit",
      "name": "Cloud Cost Optimisation: Audit",
      "category": "Audit",
      "description": "[Cloud Cost Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "triggerPhrase": "You need to examine the current \"Cloud Cost Optimisation\" setup without making changes. Look for the specific failure pattern: \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Cloud Cost Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Use the best practice Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments. as your evaluation baseline. Verify your findings with cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Cloud Cost Optimisation setup\" — produce an inventory of right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report and flag issues related to Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.",
        "\"Check Cloud Cost Optimisation health\" — run cloud cost explorer and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:audit",
          "audit",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "code-review-checklist-audit",
      "name": "Code Review Checklist: Audit",
      "category": "Audit",
      "description": "[Code Review Checklist] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "triggerPhrase": "You need to examine the current \"Code Review Checklist\" setup without making changes. Look for the specific failure pattern: \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Code Review Checklist. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Use the best practice Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order. as your evaluation baseline. Verify your findings with git diff --stat + lint-staged + danger.js automated review + commitlint. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Code Review Checklist setup\" — produce an inventory of review checklist / automated review comment / risk classification / diff summary and flag issues related to Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.",
        "\"Check Code Review Checklist health\" — run git diff --stat and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:code-review-checklist",
          "workflow:audit",
          "audit",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "convex-functions-audit",
      "name": "Convex Functions & Mutations: Audit",
      "category": "Audit",
      "description": "[Convex Functions & Mutations] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "triggerPhrase": "You need to examine the current \"Convex Functions & Mutations\" setup without making changes. Look for the specific failure pattern: \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Convex Functions & Mutations. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Use the best practice Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back. as your evaluation baseline. Verify your findings with npx convex dev + dashboard OCC conflict log + custom retry logic. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific mutation / query / action / component / scheduler job this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Convex Functions & Mutations setup\" — produce an inventory of mutation / query / action / component / scheduler job and flag issues related to Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.",
        "\"Check Convex Functions & Mutations health\" — run npx convex dev and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:convex-functions",
          "workflow:audit",
          "audit",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cron-job-reliability-audit",
      "name": "Cron Job & Scheduled Task Reliability: Audit",
      "category": "Audit",
      "description": "[Cron Job & Scheduled Task Reliability] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "triggerPhrase": "You need to examine the current \"Cron Job & Scheduled Task Reliability\" setup without making changes. Look for the specific failure pattern: \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Cron Job & Scheduled Task Reliability. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Use the best practice Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects. as your evaluation baseline. Verify your findings with tail -f /var/log/cron + systemctl status cron + idempotency test script. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Cron Job & Scheduled Task Reliability setup\" — produce an inventory of crontab entry / log rotation / idempotency guard / failure alert integration and flag issues related to Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.",
        "\"Check Cron Job & Scheduled Task Reliability health\" — run tail -f /var/log/cron and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cron-job-reliability",
          "workflow:audit",
          "audit",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "css-layout-audit",
      "name": "CSS Layout & Responsiveness: Audit",
      "category": "Audit",
      "description": "[CSS Layout & Responsiveness] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "triggerPhrase": "You need to examine the current \"CSS Layout & Responsiveness\" setup without making changes. Look for the specific failure pattern: \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing CSS Layout & Responsiveness. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Use the best practice Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints. as your evaluation baseline. Verify your findings with Lighthouse mobile emulation + browser DevTools responsive mode. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current CSS Layout & Responsiveness setup\" — produce an inventory of CSS layout refactor / responsive grid / container query implementation and flag issues related to Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.",
        "\"Check CSS Layout & Responsiveness health\" — run Lighthouse mobile emulation and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:css-layout",
          "workflow:audit",
          "audit",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "csv-data-cleaning-audit",
      "name": "CSV Data Cleaning Pipeline: Audit",
      "category": "Audit",
      "description": "[CSV Data Cleaning Pipeline] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "triggerPhrase": "You need to examine the current \"CSV Data Cleaning Pipeline\" setup without making changes. Look for the specific failure pattern: \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing CSV Data Cleaning Pipeline. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Use the best practice Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row. as your evaluation baseline. Verify your findings with python3 -c csv.DictReader + validation script + row count diff. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current CSV Data Cleaning Pipeline setup\" — produce an inventory of CSV parser / row validator / column type mapper / error report / cleaned output and flag issues related to Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.",
        "\"Check CSV Data Cleaning Pipeline health\" — run python3 -c csv.DictReader and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:audit",
          "audit",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "database-migration-safety-audit",
      "name": "Database Migration Safety: Audit",
      "category": "Audit",
      "description": "[Database Migration Safety] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "triggerPhrase": "You need to examine the current \"Database Migration Safety\" setup without making changes. Look for the specific failure pattern: \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Database Migration Safety. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Use the best practice Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default. as your evaluation baseline. Verify your findings with pg_locks monitoring during migration + batch backfill script + rollback test. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Database Migration Safety setup\" — produce an inventory of batch migration / expand-contract pattern / zero-downtime migration / rollback plan and flag issues related to Running a long-running migration (e.",
        "\"Check Database Migration Safety health\" — run pg_locks monitoring during migration and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:database-migration-safety",
          "workflow:audit",
          "audit",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "data-warehouse-schema-audit",
      "name": "Data Warehouse Schema Design: Audit",
      "category": "Audit",
      "description": "[Data Warehouse Schema Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "triggerPhrase": "You need to examine the current \"Data Warehouse Schema Design\" setup without making changes. Look for the specific failure pattern: \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Data Warehouse Schema Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Use the best practice Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time. as your evaluation baseline. Verify your findings with dbt run + dbt test + query profiling with warehouse-native tools. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Data Warehouse Schema Design setup\" — produce an inventory of star schema / fact table / dimension table / ETL pipeline spec and flag issues related to Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.",
        "\"Check Data Warehouse Schema Design health\" — run dbt run and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:audit",
          "audit",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "design-token-system-audit",
      "name": "Design Token Systems: Audit",
      "category": "Audit",
      "description": "[Design Token Systems] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "triggerPhrase": "You need to examine the current \"Design Token Systems\" setup without making changes. Look for the specific failure pattern: \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Design Token Systems. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Use the best practice Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values. as your evaluation baseline. Verify your findings with style-dictionary build + Storybook token viewer + token value comparison. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Design Token Systems setup\" — produce an inventory of token JSON / CSS custom properties / theme switcher / token documentation and flag issues related to Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.",
        "\"Check Design Token Systems health\" — run style-dictionary build and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:design-token-system",
          "workflow:audit",
          "audit",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-compose-networking-audit",
      "name": "Docker Compose Networking: Audit",
      "category": "Audit",
      "description": "[Docker Compose Networking] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "triggerPhrase": "You need to examine the current \"Docker Compose Networking\" setup without making changes. Look for the specific failure pattern: \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Docker Compose Networking. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Use the best practice All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'. as your evaluation baseline. Verify your findings with docker compose up --wait + docker network inspect + container logs. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Docker Compose Networking setup\" — produce an inventory of docker-compose.yml / network config / healthcheck / depends_on condition and flag issues related to Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.",
        "\"Check Docker Compose Networking health\" — run docker compose up --wait and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-compose-networking",
          "workflow:audit",
          "audit",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-multistage-audit",
      "name": "Docker Multi-Stage Builds: Audit",
      "category": "Audit",
      "description": "[Docker Multi-Stage Builds] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "triggerPhrase": "You need to examine the current \"Docker Multi-Stage Builds\" setup without making changes. Look for the specific failure pattern: \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Docker Multi-Stage Builds. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Use the best practice Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app. as your evaluation baseline. Verify your findings with docker build + docker scout + dive layer analysis. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Docker Multi-Stage Builds setup\" — produce an inventory of multi-stage Dockerfile / .dockerignore / slim base image switch and flag issues related to Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.",
        "\"Check Docker Multi-Stage Builds health\" — run docker build and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-multistage",
          "workflow:audit",
          "audit",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "drizzle-schema-design-audit",
      "name": "Drizzle Schema Design: Audit",
      "category": "Audit",
      "description": "[Drizzle Schema Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "triggerPhrase": "You need to examine the current \"Drizzle Schema Design\" setup without making changes. Look for the specific failure pattern: \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Drizzle Schema Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Use the best practice Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly. as your evaluation baseline. Verify your findings with drizzle-kit push + drizzle-kit studio + generated SQL audit. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Drizzle Schema Design setup\" — produce an inventory of schema.ts / relation map / migration SQL / Drizzle query builder and flag issues related to Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.",
        "\"Check Drizzle Schema Design health\" — run drizzle-kit push and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:audit",
          "audit",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "error-monitoring-setup-audit",
      "name": "Error Monitoring & Alerting Setup: Audit",
      "category": "Audit",
      "description": "[Error Monitoring & Alerting Setup] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "triggerPhrase": "You need to examine the current \"Error Monitoring & Alerting Setup\" setup without making changes. Look for the specific failure pattern: \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Error Monitoring & Alerting Setup. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Use the best practice Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold). as your evaluation baseline. Verify your findings with Sentry API error list + alert rule test + source map validation. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Error Monitoring & Alerting Setup setup\" — produce an inventory of Sentry project config / alert rule / error grouping / source map upload / performance monitoring and flag issues related to Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.",
        "\"Check Error Monitoring & Alerting Setup health\" — run Sentry API error list and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:audit",
          "audit",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "fastapi-dependencies-audit",
      "name": "FastAPI Dependency Injection: Audit",
      "category": "Audit",
      "description": "[FastAPI Dependency Injection] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "triggerPhrase": "You need to examine the current \"FastAPI Dependency Injection\" setup without making changes. Look for the specific failure pattern: \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing FastAPI Dependency Injection. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Use the best practice Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends(). as your evaluation baseline. Verify your findings with uvicorn --reload + /docs interactive test + dependency graph visualisation. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific dependency / lifespan handler / override for testing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current FastAPI Dependency Injection setup\" — produce an inventory of dependency / lifespan handler / override for testing and flag issues related to Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.",
        "\"Check FastAPI Dependency Injection health\" — run uvicorn --reload and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:audit",
          "audit",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "feature-flags-audit",
      "name": "Feature Flags & Gradual Rollouts: Audit",
      "category": "Audit",
      "description": "[Feature Flags & Gradual Rollouts] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "triggerPhrase": "You need to examine the current \"Feature Flags & Gradual Rollouts\" setup without making changes. Look for the specific failure pattern: \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Feature Flags & Gradual Rollouts. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Use the best practice Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely. as your evaluation baseline. Verify your findings with flag evaluation log + rollout percentage monitoring + unused flag scan. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Feature Flags & Gradual Rollouts setup\" — produce an inventory of flag provider config / gradual rollout target / flag cleanup plan / A/B test flag and flag issues related to Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.",
        "\"Check Feature Flags & Gradual Rollouts health\" — run flag evaluation log and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:feature-flags",
          "workflow:audit",
          "audit",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "git-conflict-resolution-audit",
      "name": "Git Conflict Resolution: Audit",
      "category": "Audit",
      "description": "[Git Conflict Resolution] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "triggerPhrase": "You need to examine the current \"Git Conflict Resolution\" setup without making changes. Look for the specific failure pattern: \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Git Conflict Resolution. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Use the best practice For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution. as your evaluation baseline. Verify your findings with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Git Conflict Resolution setup\" — produce an inventory of conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message and flag issues related to Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.",
        "\"Check Git Conflict Resolution health\" — run git log --oneline -5 -- <file> and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:audit",
          "audit",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "github-actions-pipeline-audit",
      "name": "GitHub Actions Pipeline Optimisation: Audit",
      "category": "Audit",
      "description": "[GitHub Actions Pipeline Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "triggerPhrase": "You need to examine the current \"GitHub Actions Pipeline Optimisation\" setup without making changes. Look for the specific failure pattern: \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing GitHub Actions Pipeline Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Use the best practice Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs. as your evaluation baseline. Verify your findings with act --job test + cache hit/miss analysis + workflow graph visualisation. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current GitHub Actions Pipeline Optimisation setup\" — produce an inventory of workflow YAML / cache config / matrix build / conditional job execution and flag issues related to Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.",
        "\"Check GitHub Actions Pipeline Optimisation health\" — run act --job test and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:audit",
          "audit",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "graphql-n-plus-one-audit",
      "name": "GraphQL N+1 Query Prevention: Audit",
      "category": "Audit",
      "description": "[GraphQL N+1 Query Prevention] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "triggerPhrase": "You need to examine the current \"GraphQL N+1 Query Prevention\" setup without making changes. Look for the specific failure pattern: \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing GraphQL N+1 Query Prevention. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Use the best practice Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle. as your evaluation baseline. Verify your findings with graphql query with tracing + DataLoader statistics + SQL log analysis. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current GraphQL N+1 Query Prevention setup\" — produce an inventory of DataLoader instance / batch load function / resolver refactor / query complexity analysis and flag issues related to A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.",
        "\"Check GraphQL N+1 Query Prevention health\" — run graphql query with tracing and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:audit",
          "audit",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "jest-test-optimization-audit",
      "name": "Jest Test Optimisation: Audit",
      "category": "Audit",
      "description": "[Jest Test Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "triggerPhrase": "You need to examine the current \"Jest Test Optimisation\" setup without making changes. Look for the specific failure pattern: \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Jest Test Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Use the best practice Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback. as your evaluation baseline. Verify your findings with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Jest Test Optimisation setup\" — produce an inventory of jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking and flag issues related to Running the entire test suite on every change, taking minutes even for small incremental code changes.",
        "\"Check Jest Test Optimisation health\" — run jest --changedSince=main --json and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:jest-test-optimization",
          "workflow:audit",
          "audit",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "json-schema-validation-audit",
      "name": "JSON Schema Validation: Audit",
      "category": "Audit",
      "description": "[JSON Schema Validation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "triggerPhrase": "You need to examine the current \"JSON Schema Validation\" setup without making changes. Look for the specific failure pattern: \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing JSON Schema Validation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Use the best practice Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation. as your evaluation baseline. Verify your findings with ajv validate + JSON Schema test suite + response mock test. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current JSON Schema Validation setup\" — produce an inventory of JSON Schema / validator middleware / type guard / error message / response parser and flag issues related to Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.",
        "\"Check JSON Schema Validation health\" — run ajv validate and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:json-schema-validation",
          "workflow:audit",
          "audit",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-hpa-audit",
      "name": "Kubernetes Horizontal Pod Autoscaling: Audit",
      "category": "Audit",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "triggerPhrase": "You need to examine the current \"Kubernetes Horizontal Pod Autoscaling\" setup without making changes. Look for the specific failure pattern: \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Kubernetes Horizontal Pod Autoscaling. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Use the best practice Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined. as your evaluation baseline. Verify your findings with kubectl get hpa --watch + kubectl top pods + metrics-server logs. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Kubernetes Horizontal Pod Autoscaling setup\" — produce an inventory of HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config and flag issues related to HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.",
        "\"Check Kubernetes Horizontal Pod Autoscaling health\" — run kubectl get hpa --watch and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:audit",
          "audit",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-pod-lifecycle-audit",
      "name": "Kubernetes Pod Lifecycle: Audit",
      "category": "Audit",
      "description": "[Kubernetes Pod Lifecycle] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "triggerPhrase": "You need to examine the current \"Kubernetes Pod Lifecycle\" setup without making changes. Look for the specific failure pattern: \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Kubernetes Pod Lifecycle. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Use the best practice Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity. as your evaluation baseline. Verify your findings with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Kubernetes Pod Lifecycle setup\" — produce an inventory of deployment.yaml / startup probe / readiness probe / liveness probe / init container and flag issues related to Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.",
        "\"Check Kubernetes Pod Lifecycle health\" — run kubectl describe pod and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:audit",
          "audit",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "context-window-budget-audit",
      "name": "LLM Context Window Budget Management: Audit",
      "category": "Audit",
      "description": "[LLM Context Window Budget Management] Audit the current setup; do NOT modify files; produce a structured inventory and a risk-ranked list of findings Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "triggerPhrase": "You need to examine the current \"LLM Context Window Budget Management\" setup without making changes. Look for the specific failure pattern: \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing LLM Context Window Budget Management. Follow Audit the current setup; do NOT modify files; produce a structured inventory and a risk-ranked list of findings. Specifically check for: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Use the best practice Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible. as your evaluation baseline. Verify your findings with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "checklist",
          "name": "chk",
          "description": "CHK output"
        }
      ],
      "examples": [
        "\"Audit the current LLM Context Window Budget Management setup\" — produce an inventory of trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard and flag issues related to Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content.",
        "\"Check LLM Context Window Budget Management health\" — run tiktoken count and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:context-window-budget",
          "workflow:audit",
          "audit",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "mcp-tool-design-audit",
      "name": "MCP Tool Design & Best Practices: Audit",
      "category": "Audit",
      "description": "[MCP Tool Design & Best Practices] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "triggerPhrase": "You need to examine the current \"MCP Tool Design & Best Practices\" setup without making changes. Look for the specific failure pattern: \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing MCP Tool Design & Best Practices. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Use the best practice Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool. as your evaluation baseline. Verify your findings with mcp-cli run + mcp inspector + tool name conflict analysis. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current MCP Tool Design & Best Practices setup\" — produce an inventory of MCP tool descriptor / resource definition / prompt template / server metadata and flag issues related to Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.",
        "\"Check MCP Tool Design & Best Practices health\" — run mcp-cli run and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:mcp-tool-design",
          "workflow:audit",
          "audit",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "message-queues-audit",
      "name": "Message Queues & Background Jobs: Audit",
      "category": "Audit",
      "description": "[Message Queues & Background Jobs] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "triggerPhrase": "You need to examine the current \"Message Queues & Background Jobs\" setup without making changes. Look for the specific failure pattern: \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Message Queues & Background Jobs. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Use the best practice Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted. as your evaluation baseline. Verify your findings with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Message Queues & Background Jobs setup\" — produce an inventory of queue producer / worker / dead-letter handler / retry policy and flag issues related to Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.",
        "\"Check Message Queues & Background Jobs health\" — run Bull/BullMQ dashboard and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:message-queues",
          "workflow:audit",
          "audit",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "multi-tenant-isolation-audit",
      "name": "Multi-Tenant Data Isolation: Audit",
      "category": "Audit",
      "description": "[Multi-Tenant Data Isolation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "triggerPhrase": "You need to examine the current \"Multi-Tenant Data Isolation\" setup without making changes. Look for the specific failure pattern: \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Multi-Tenant Data Isolation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Use the best practice Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause. as your evaluation baseline. Verify your findings with RLS policy test with two different tenant sessions + data leakage check. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Multi-Tenant Data Isolation setup\" — produce an inventory of RLS policy / tenant context middleware / session variable injection / tenant-aware query builder and flag issues related to Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.",
        "\"Check Multi-Tenant Data Isolation health\" — run RLS policy test with two different tenant sessions and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:audit",
          "audit",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-api-routes-audit",
      "name": "Next.js API Routes & Route Handlers: Audit",
      "category": "Audit",
      "description": "[Next.js API Routes & Route Handlers] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "triggerPhrase": "You need to examine the current \"Next.js API Routes & Route Handlers\" setup without making changes. Look for the specific failure pattern: \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Next.js API Routes & Route Handlers. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Use the best practice All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components. as your evaluation baseline. Verify your findings with curl --verbose + API route error log + status code audit. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Next.js API Routes & Route Handlers setup\" — produce an inventory of route.ts handler / server action / API client wrapper / error boundary and flag issues related to Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.",
        "\"Check Next.js API Routes & Route Handlers health\" — run curl --verbose and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:audit",
          "audit",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-data-fetching-audit",
      "name": "Next.js Data Fetching Patterns: Audit",
      "category": "Audit",
      "description": "[Next.js Data Fetching Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "triggerPhrase": "You need to examine the current \"Next.js Data Fetching Patterns\" setup without making changes. Look for the specific failure pattern: \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Next.js Data Fetching Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Use the best practice Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes. as your evaluation baseline. Verify your findings with next build --debug + React DevTools fetch profiling. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Next.js Data Fetching Patterns setup\" — produce an inventory of server fetch / React cache wrapper / streaming suspense boundary and flag issues related to Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.",
        "\"Check Next.js Data Fetching Patterns health\" — run next build --debug and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:audit",
          "audit",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-middleware-audit",
      "name": "Next.js Middleware & Edge Runtime: Audit",
      "category": "Audit",
      "description": "[Next.js Middleware & Edge Runtime] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "triggerPhrase": "You need to examine the current \"Next.js Middleware & Edge Runtime\" setup without making changes. Look for the specific failure pattern: \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Next.js Middleware & Edge Runtime. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Use the best practice Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks. as your evaluation baseline. Verify your findings with next dev + curl --cookie tests + edge runtime log inspection. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Next.js Middleware & Edge Runtime setup\" — produce an inventory of middleware.ts / rewrite rule / cookie-based redirect / geolocation routing and flag issues related to Using Node.",
        "\"Check Next.js Middleware & Edge Runtime health\" — run next dev and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-middleware",
          "workflow:audit",
          "audit",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-error-handling-audit",
      "name": "Node.js Error Handling & Resilience: Audit",
      "category": "Audit",
      "description": "[Node.js Error Handling & Resilience] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "triggerPhrase": "You need to examine the current \"Node.js Error Handling & Resilience\" setup without making changes. Look for the specific failure pattern: \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Node.js Error Handling & Resilience. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Use the best practice Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function. as your evaluation baseline. Verify your findings with node --unhandled-rejections=strict + process.on('uncaughtException') log. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Node.js Error Handling & Resilience setup\" — produce an inventory of global error handler / async wrapper / structured error response / retry logic and flag issues related to Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.",
        "\"Check Node.js Error Handling & Resilience health\" — run node --unhandled-rejections=strict and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-error-handling",
          "workflow:audit",
          "audit",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-streams-audit",
      "name": "Node.js Streams & Backpressure: Audit",
      "category": "Audit",
      "description": "[Node.js Streams & Backpressure] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "triggerPhrase": "You need to examine the current \"Node.js Streams & Backpressure\" setup without making changes. Look for the specific failure pattern: \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Node.js Streams & Backpressure. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Use the best practice Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error. as your evaluation baseline. Verify your findings with Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Node.js Streams & Backpressure setup\" — produce an inventory of Readable/Writable stream / Transform / pipeline() refactor and flag issues related to Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.",
        "\"Check Node.js Streams & Backpressure health\" — run Node.js --inspect memory heap snapshot and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-streams",
          "workflow:audit",
          "audit",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "oauth-flows-audit",
      "name": "OAuth 2.0 Flows & Token Management: Audit",
      "category": "Audit",
      "description": "[OAuth 2.0 Flows & Token Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "triggerPhrase": "You need to examine the current \"OAuth 2.0 Flows & Token Management\" setup without making changes. Look for the specific failure pattern: \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing OAuth 2.0 Flows & Token Management. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Use the best practice Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use. as your evaluation baseline. Verify your findings with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current OAuth 2.0 Flows & Token Management setup\" — produce an inventory of OAuth callback / token refresh / PKCE flow / httpOnly cookie handler and flag issues related to Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.",
        "\"Check OAuth 2.0 Flows & Token Management health\" — run oauth2_proxy and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:oauth-flows",
          "workflow:audit",
          "audit",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "openapi-spec-audit",
      "name": "OpenAPI Specification & Validation: Audit",
      "category": "Audit",
      "description": "[OpenAPI Specification & Validation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "triggerPhrase": "You need to examine the current \"OpenAPI Specification & Validation\" setup without making changes. Look for the specific failure pattern: \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing OpenAPI Specification & Validation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Use the best practice Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes. as your evaluation baseline. Verify your findings with redocly lint + openapi-diff + swagger-ui preview. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current OpenAPI Specification & Validation setup\" — produce an inventory of openapi.yaml / code-first generator / request/response validation middleware and flag issues related to Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.",
        "\"Check OpenAPI Specification & Validation health\" — run redocly lint and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:openapi-spec",
          "workflow:audit",
          "audit",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "playwright-selectors-audit",
      "name": "Playwright Selectors & Locators: Audit",
      "category": "Audit",
      "description": "[Playwright Selectors & Locators] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "triggerPhrase": "You need to examine the current \"Playwright Selectors & Locators\" setup without making changes. Look for the specific failure pattern: \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Playwright Selectors & Locators. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Use the best practice Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes. as your evaluation baseline. Verify your findings with playwright test --reporter=html + playwright codegen + trace viewer. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Playwright Selectors & Locators setup\" — produce an inventory of locator refactor / test fixture / POM (Page Object Model) / custom fixture and flag issues related to Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.",
        "\"Check Playwright Selectors & Locators health\" — run playwright test --reporter=html and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:playwright-selectors",
          "workflow:audit",
          "audit",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "prompt-injection-defense-audit",
      "name": "Prompt Injection Defense: Audit",
      "category": "Audit",
      "description": "[Prompt Injection Defense] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "triggerPhrase": "You need to examine the current \"Prompt Injection Defense\" setup without making changes. Look for the specific failure pattern: \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Prompt Injection Defense. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Use the best practice Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts. as your evaluation baseline. Verify your findings with prompt injection test suite + adversarial input fuzzing + output scanner. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Prompt Injection Defense setup\" — produce an inventory of defensive system prompt / input sanitizer / instruction guardrail / output validator and flag issues related to Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.",
        "\"Check Prompt Injection Defense health\" — run prompt injection test suite and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:audit",
          "audit",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-async-audit",
      "name": "Python Async/Await Patterns: Audit",
      "category": "Audit",
      "description": "[Python Async/Await Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "triggerPhrase": "You need to examine the current \"Python Async/Await Patterns\" setup without making changes. Look for the specific failure pattern: \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Python Async/Await Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Use the best practice Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function. as your evaluation baseline. Verify your findings with python3 -m asyncio + aiohttp/httpx async benchmark. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Python Async/Await Patterns setup\" — produce an inventory of async/await refactor / asyncio.gather / async context manager and flag issues related to Blocking the event loop by using synchronous requests or time.",
        "\"Check Python Async/Await Patterns health\" — run python3 -m asyncio and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-async",
          "workflow:audit",
          "audit",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-file-io-audit",
      "name": "Python File I/O & Encoding: Audit",
      "category": "Audit",
      "description": "[Python File I/O & Encoding] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "triggerPhrase": "You need to examine the current \"Python File I/O & Encoding\" setup without making changes. Look for the specific failure pattern: \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Python File I/O & Encoding. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Use the best practice Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code. as your evaluation baseline. Verify your findings with python3 -c with open() + chardet encoding detection. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Python File I/O & Encoding setup\" — produce an inventory of pathlib refactor / encoding-safe file reader / batch file processor and flag issues related to Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.",
        "\"Check Python File I/O & Encoding health\" — run python3 -c with open() and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-file-io",
          "workflow:audit",
          "audit",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rag-chunking-audit",
      "name": "RAG Chunking Strategies: Audit",
      "category": "Audit",
      "description": "[RAG Chunking Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "triggerPhrase": "You need to examine the current \"RAG Chunking Strategies\" setup without making changes. Look for the specific failure pattern: \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing RAG Chunking Strategies. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Use the best practice Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries. as your evaluation baseline. Verify your findings with retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current RAG Chunking Strategies setup\" — produce an inventory of semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment and flag issues related to Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.",
        "\"Check RAG Chunking Strategies health\" — run retrieval evaluation script and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rag-chunking",
          "workflow:audit",
          "audit",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rate-limiting-proxy-audit",
      "name": "Rate Limiting & API Gateway Proxy: Audit",
      "category": "Audit",
      "description": "[Rate Limiting & API Gateway Proxy] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "triggerPhrase": "You need to examine the current \"Rate Limiting & API Gateway Proxy\" setup without making changes. Look for the specific failure pattern: \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Rate Limiting & API Gateway Proxy. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Use the best practice Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server. as your evaluation baseline. Verify your findings with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Rate Limiting & API Gateway Proxy setup\" — produce an inventory of NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation and flag issues related to Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.",
        "\"Check Rate Limiting & API Gateway Proxy health\" — run ab -n 1000 -c 10 and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:audit",
          "audit",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-server-components-audit",
      "name": "React Server Components: Audit",
      "category": "Audit",
      "description": "[React Server Components] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "triggerPhrase": "You need to examine the current \"React Server Components\" setup without making changes. Look for the specific failure pattern: \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing React Server Components. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Use the best practice Keep data fetching and heavy logic in server components; pass results as props to client islands. as your evaluation baseline. Verify your findings with next build --debug + React Server Components lint rule. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current React Server Components setup\" — produce an inventory of server component / client boundary refactor / streaming fallback and flag issues related to Accidentally making a server component a client component by using hooks or event handlers in the wrong file.",
        "\"Check React Server Components health\" — run next build --debug and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-server-components",
          "workflow:audit",
          "audit",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-state-audit",
      "name": "React State Management: Audit",
      "category": "Audit",
      "description": "[React State Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "triggerPhrase": "You need to examine the current \"React State Management\" setup without making changes. Look for the specific failure pattern: \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing React State Management. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Use the best practice Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it. as your evaluation baseline. Verify your findings with React DevTools profiler + why-did-you-render. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current React State Management setup\" — produce an inventory of useState / useReducer / useContext hook refactor, zustand or jotai store slice and flag issues related to Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.",
        "\"Check React State Management health\" — run React DevTools profiler and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-state",
          "workflow:audit",
          "audit",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "redis-caching-audit",
      "name": "Redis Caching Strategies: Audit",
      "category": "Audit",
      "description": "[Redis Caching Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "triggerPhrase": "You need to examine the current \"Redis Caching Strategies\" setup without making changes. Look for the specific failure pattern: \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Redis Caching Strategies. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Use the best practice Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed. as your evaluation baseline. Verify your findings with redis-cli --stat + cache hit ratio monitoring + slow log. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Redis Caching Strategies setup\" — produce an inventory of cache wrapper / mutex lock / stale-while-revalidate / TTL policy and flag issues related to Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.",
        "\"Check Redis Caching Strategies health\" — run redis-cli --stat and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:redis-caching",
          "workflow:audit",
          "audit",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rest-pagination-audit",
      "name": "REST Pagination Design: Audit",
      "category": "Audit",
      "description": "[REST Pagination Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "triggerPhrase": "You need to examine the current \"REST Pagination Design\" setup without making changes. Look for the specific failure pattern: \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing REST Pagination Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Use the best practice Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value. as your evaluation baseline. Verify your findings with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current REST Pagination Design setup\" — produce an inventory of cursor pagination / offset pagination fallback / total count optimisation / response envelope and flag issues related to Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.",
        "\"Check REST Pagination Design health\" — run curl with cursor param and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rest-pagination",
          "workflow:audit",
          "audit",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "secrets-rotation-audit",
      "name": "Secrets Rotation Policy: Audit",
      "category": "Audit",
      "description": "[Secrets Rotation Policy] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "triggerPhrase": "You need to examine the current \"Secrets Rotation Policy\" setup without making changes. Look for the specific failure pattern: \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Secrets Rotation Policy. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Use the best practice Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files. as your evaluation baseline. Verify your findings with vault lease list + secret expiry check + rotation dry-run test. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Secrets Rotation Policy setup\" — produce an inventory of rotation script / vault integration / lease management / incident response plan and flag issues related to Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.",
        "\"Check Secrets Rotation Policy health\" — run vault lease list and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:secrets-rotation",
          "workflow:audit",
          "audit",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "shell-script-robustness-audit",
      "name": "Shell Script Robustness & Safety: Audit",
      "category": "Audit",
      "description": "[Shell Script Robustness & Safety] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "triggerPhrase": "You need to examine the current \"Shell Script Robustness & Safety\" setup without making changes. Look for the specific failure pattern: \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Shell Script Robustness & Safety. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Use the best practice Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script. as your evaluation baseline. Verify your findings with shellcheck script.sh + bash -n script.sh + dry-run mode test. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Shell Script Robustness & Safety setup\" — produce an inventory of set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function and flag issues related to Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.",
        "\"Check Shell Script Robustness & Safety health\" — run shellcheck script.sh and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:shell-script-robustness",
          "workflow:audit",
          "audit",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "sql-query-optimization-audit",
      "name": "SQL Query Optimisation: Audit",
      "category": "Audit",
      "description": "[SQL Query Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "triggerPhrase": "You need to examine the current \"SQL Query Optimisation\" setup without making changes. Look for the specific failure pattern: \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing SQL Query Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Use the best practice Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly. as your evaluation baseline. Verify your findings with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current SQL Query Optimisation setup\" — produce an inventory of indexed query / composite index / EXPLAIN ANALYSE plan / partial index and flag issues related to Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.",
        "\"Check SQL Query Optimisation health\" — run EXPLAIN (ANALYSE, BUFFERS) and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:sql-query-optimization",
          "workflow:audit",
          "audit",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stealth-web-research-audit",
      "name": "Stealth Web Research & Harvesting: Audit",
      "category": "Audit",
      "description": "[Stealth Web Research & Harvesting] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "triggerPhrase": "You need to examine the current \"Stealth Web Research & Harvesting\" setup without making changes. Look for the specific failure pattern: \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Stealth Web Research & Harvesting. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Use the best practice Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers. as your evaluation baseline. Verify your findings with playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Stealth Web Research & Harvesting setup\" — produce an inventory of clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages and flag issues related to Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.",
        "\"Check Stealth Web Research & Harvesting health\" — run playwright-extra and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stealth-web-research",
          "workflow:audit",
          "audit",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stripe-webhook-idempotency-audit",
      "name": "Stripe Webhook Idempotency: Audit",
      "category": "Audit",
      "description": "[Stripe Webhook Idempotency] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "triggerPhrase": "You need to examine the current \"Stripe Webhook Idempotency\" setup without making changes. Look for the specific failure pattern: \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Stripe Webhook Idempotency. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Use the best practice Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events. as your evaluation baseline. Verify your findings with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Stripe Webhook Idempotency setup\" — produce an inventory of Webhook handler / idempotency key check / event deduplication / failed payment recovery and flag issues related to Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.",
        "\"Check Stripe Webhook Idempotency health\" — run stripe trigger payment_intent.succeeded and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:audit",
          "audit",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "supabase-rls-audit",
      "name": "Supabase Row-Level Security: Audit",
      "category": "Audit",
      "description": "[Supabase Row-Level Security] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "triggerPhrase": "You need to examine the current \"Supabase Row-Level Security\" setup without making changes. Look for the specific failure pattern: \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Supabase Row-Level Security. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Use the best practice Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production. as your evaluation baseline. Verify your findings with supabase db check + supabase db test + RLS policy review with pg_policies. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Supabase Row-Level Security setup\" — produce an inventory of RLS policy / policy test / security definer function / admin bypass and flag issues related to RLS policies that are too permissive (using 'true' instead of 'auth.",
        "\"Check Supabase Row-Level Security health\" — run supabase db check and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:supabase-rls",
          "workflow:audit",
          "audit",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "terraform-state-audit",
      "name": "Terraform State Management: Audit",
      "category": "Audit",
      "description": "[Terraform State Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "triggerPhrase": "You need to examine the current \"Terraform State Management\" setup without making changes. Look for the specific failure pattern: \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Terraform State Management. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Use the best practice Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent. as your evaluation baseline. Verify your findings with terraform plan + terraform state list + terraform state pull | jq. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Terraform State Management setup\" — produce an inventory of backend config / state migration plan / state locking config / remote state datasource and flag issues related to Losing the .",
        "\"Check Terraform State Management health\" — run terraform plan and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:terraform-state",
          "workflow:audit",
          "audit",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "typescript-generics-audit",
      "name": "TypeScript Generics & Advanced Types: Audit",
      "category": "Audit",
      "description": "[TypeScript Generics & Advanced Types] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "triggerPhrase": "You need to examine the current \"TypeScript Generics & Advanced Types\" setup without making changes. Look for the specific failure pattern: \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing TypeScript Generics & Advanced Types. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Use the best practice Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property. as your evaluation baseline. Verify your findings with tsc --noEmit --strict + type tests with expect-type. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current TypeScript Generics & Advanced Types setup\" — produce an inventory of generic type / conditional type / mapped type / branded type and flag issues related to Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).",
        "\"Check TypeScript Generics & Advanced Types health\" — run tsc --noEmit --strict and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:typescript-generics",
          "workflow:audit",
          "audit",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "user-onboarding-flow-audit",
      "name": "User Onboarding Flow Design: Audit",
      "category": "Audit",
      "description": "[User Onboarding Flow Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "triggerPhrase": "You need to examine the current \"User Onboarding Flow Design\" setup without making changes. Look for the specific failure pattern: \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing User Onboarding Flow Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Use the best practice Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal. as your evaluation baseline. Verify your findings with analytics funnel analysis + onboarding completion rate + drop-off heatmap. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current User Onboarding Flow Design setup\" — produce an inventory of onboarding wizard / feature checklist / in-app guide / first-run experience spec and flag issues related to Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.",
        "\"Check User Onboarding Flow Design health\" — run analytics funnel analysis and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:audit",
          "audit",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "vercel-env-vars-audit",
      "name": "Vercel Environment Variables: Audit",
      "category": "Audit",
      "description": "[Vercel Environment Variables] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "triggerPhrase": "You need to examine the current \"Vercel Environment Variables\" setup without making changes. Look for the specific failure pattern: \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Vercel Environment Variables. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Use the best practice Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'. as your evaluation baseline. Verify your findings with vercel env pull + vercel list + project settings audit. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Vercel Environment Variables setup\" — produce an inventory of vercel.json env group / preview env config / Edge Config / KV store and flag issues related to Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.",
        "\"Check Vercel Environment Variables health\" — run vercel env pull and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:vercel-env-vars",
          "workflow:audit",
          "audit",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-scraping-ethics-audit",
      "name": "Web Scraping Ethics & Compliance: Audit",
      "category": "Audit",
      "description": "[Web Scraping Ethics & Compliance] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "triggerPhrase": "You need to examine the current \"Web Scraping Ethics & Compliance\" setup without making changes. Look for the specific failure pattern: \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Web Scraping Ethics & Compliance. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Use the best practice Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information. as your evaluation baseline. Verify your findings with curl robots.txt + wget --wait + scraper log audit. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Web Scraping Ethics & Compliance setup\" — produce an inventory of robots.txt check / polite scraper / rate-limited crawler / cached scraper and flag issues related to Scraping a website that explicitly prohibits it in robots.",
        "\"Check Web Scraping Ethics & Compliance health\" — run curl robots.txt and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:audit",
          "audit",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "websocket-reconnection-audit",
      "name": "WebSocket Reconnection Strategies: Audit",
      "category": "Audit",
      "description": "[WebSocket Reconnection Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "triggerPhrase": "You need to examine the current \"WebSocket Reconnection Strategies\" setup without making changes. Look for the specific failure pattern: \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing WebSocket Reconnection Strategies. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Use the best practice Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI. as your evaluation baseline. Verify your findings with Browser DevTools Network tab WS filter + reconnection test with server restart. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current WebSocket Reconnection Strategies setup\" — produce an inventory of WebSocket client / reconnection logic / heartbeat / connection status component and flag issues related to Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.",
        "\"Check WebSocket Reconnection Strategies health\" — run Browser DevTools Network tab WS filter and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:websocket-reconnection",
          "workflow:audit",
          "audit",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-vitals-optimization-audit",
      "name": "Web Vitals Optimisation (LCP/CLS/INP): Audit",
      "category": "Audit",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "triggerPhrase": "You need to examine the current \"Web Vitals Optimisation (LCP/CLS/INP)\" setup without making changes. Look for the specific failure pattern: \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\". Call this when you want a structured inventory before deciding what to modify.",
      "promptTemplate": "You are auditing Web Vitals Optimisation (LCP/CLS/INP). Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Use the best practice Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation. as your evaluation baseline. Verify your findings with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Do not modify any files.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Audit the current Web Vitals Optimisation (LCP/CLS/INP) setup\" — produce an inventory of image optimisation / font display swap / critical CSS / lazy load / bundle analysis and flag issues related to Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).",
        "\"Check Web Vitals Optimisation (LCP/CLS/INP) health\" — run Lighthouse CI and summarise findings."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:audit",
          "audit",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a-b-testing-framework-script",
      "name": "A/B Testing Framework: Script",
      "category": "Automation",
      "description": "[A/B Testing Framework] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "triggerPhrase": "Create a reusable automation for \"A/B Testing Framework\". The task produces experiment spec / variant assignment / metric definition / statistical analysis script. Handle the failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\". Include a dry-run mode and test with statsmodels sample size calculation + Bayesian A/B test + sequential testing.",
      "promptTemplate": "You are automating a workflow for A/B Testing Framework. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with experiment spec / variant assignment / metric definition / statistical analysis script. Guard against: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Test with statsmodels sample size calculation + Bayesian A/B test + sequential testing.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the A/B Testing Framework process\" — produce a reusable CLI that handles Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.",
        "\"Automate A/B Testing Framework\" — create a dry-run mode and test with statsmodels sample size calculation."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:script",
          "automation",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a11y-aria-patterns-script",
      "name": "Accessibility ARIA Patterns: Script",
      "category": "Automation",
      "description": "[Accessibility ARIA Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "triggerPhrase": "Create a reusable automation for \"Accessibility ARIA Patterns\". The task produces ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Handle the failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\". Include a dry-run mode and test with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit.",
      "promptTemplate": "You are automating a workflow for Accessibility ARIA Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Guard against: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Test with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Accessibility ARIA Patterns process\" — produce a reusable CLI that handles Adding ARIA attributes that conflict with native HTML semantics (e.",
        "\"Automate Accessibility ARIA Patterns\" — create a dry-run mode and test with axe-core."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:script",
          "automation",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "agent-tool-binding-script",
      "name": "Agent Tool Binding & Dispatch: Script",
      "category": "Automation",
      "description": "[Agent Tool Binding & Dispatch] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "triggerPhrase": "Create a reusable automation for \"Agent Tool Binding & Dispatch\". The task produces router tool / domain group / dynamic tool injection / tool usage statistics. Handle the failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\". Include a dry-run mode and test with agent trace log + tool invocation frequency analysis + token cost audit.",
      "promptTemplate": "You are automating a workflow for Agent Tool Binding & Dispatch. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with router tool / domain group / dynamic tool injection / tool usage statistics. Guard against: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Test with agent trace log + tool invocation frequency analysis + token cost audit.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Agent Tool Binding & Dispatch process\" — produce a reusable CLI that handles Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.",
        "\"Automate Agent Tool Binding & Dispatch\" — create a dry-run mode and test with agent trace log."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:agent-tool-binding",
          "workflow:script",
          "automation",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "analytics-metric-definition-script",
      "name": "Analytics Metric Definitions: Script",
      "category": "Automation",
      "description": "[Analytics Metric Definitions] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "triggerPhrase": "Create a reusable automation for \"Analytics Metric Definitions\". The task produces metric definition / dbt model / SQL logic / dashboard tile / documentation. Handle the failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\". Include a dry-run mode and test with dbt docs generate + dbt test --select tag:metrics + metric comparison script.",
      "promptTemplate": "You are automating a workflow for Analytics Metric Definitions. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with metric definition / dbt model / SQL logic / dashboard tile / documentation. Guard against: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Test with dbt docs generate + dbt test --select tag:metrics + metric comparison script.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Analytics Metric Definitions process\" — produce a reusable CLI that handles Different teams computing the same metric (e.",
        "\"Automate Analytics Metric Definitions\" — create a dry-run mode and test with dbt docs generate."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:script",
          "automation",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "adr-documentation-script",
      "name": "Architecture Decision Records: Script",
      "category": "Automation",
      "description": "[Architecture Decision Records] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "triggerPhrase": "Create a reusable automation for \"Architecture Decision Records\". The task produces ADR document / decision log / template / review workflow. Handle the failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\". Include a dry-run mode and test with adr-tools list + adr-tools generate + decision log index page.",
      "promptTemplate": "You are automating a workflow for Architecture Decision Records. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with ADR document / decision log / template / review workflow. Guard against: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Test with adr-tools list + adr-tools generate + decision log index page.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ADR document / decision log / template / review workflow this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Architecture Decision Records process\" — produce a reusable CLI that handles Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.",
        "\"Automate Architecture Decision Records\" — create a dry-run mode and test with adr-tools list."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:adr-documentation",
          "workflow:script",
          "automation",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "aws-lambda-cold-start-script",
      "name": "AWS Lambda Cold Starts: Script",
      "category": "Automation",
      "description": "[AWS Lambda Cold Starts] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "triggerPhrase": "Create a reusable automation for \"AWS Lambda Cold Starts\". The task produces handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Handle the failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\". Include a dry-run mode and test with AWS X-Ray trace + Lambda Insights + cold start dashboard.",
      "promptTemplate": "You are automating a workflow for AWS Lambda Cold Starts. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Guard against: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Test with AWS X-Ray trace + Lambda Insights + cold start dashboard.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the AWS Lambda Cold Starts process\" — produce a reusable CLI that handles Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.",
        "\"Automate AWS Lambda Cold Starts\" — create a dry-run mode and test with AWS X-Ray trace."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:script",
          "automation",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "azure-bicep-script",
      "name": "Azure Bicep Infrastructure: Script",
      "category": "Automation",
      "description": "[Azure Bicep Infrastructure] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "triggerPhrase": "Create a reusable automation for \"Azure Bicep Infrastructure\". The task produces main.bicep / module / parameter file / azd template. Handle the failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\". Include a dry-run mode and test with az deployment group validate + az what-if + bicep build.",
      "promptTemplate": "You are automating a workflow for Azure Bicep Infrastructure. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with main.bicep / module / parameter file / azd template. Guard against: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Test with az deployment group validate + az what-if + bicep build.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific main.bicep / module / parameter file / azd template this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Azure Bicep Infrastructure process\" — produce a reusable CLI that handles Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.",
        "\"Automate Azure Bicep Infrastructure\" — create a dry-run mode and test with az deployment group validate."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:azure-bicep",
          "workflow:script",
          "automation",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "browser-devtools-script",
      "name": "Browser DevTools & Debugging: Script",
      "category": "Automation",
      "description": "[Browser DevTools & Debugging] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "triggerPhrase": "Create a reusable automation for \"Browser DevTools & Debugging\". The task produces debugging workflow / breakpoint guide / performance recording / memory snapshot. Handle the failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\". Include a dry-run mode and test with Chrome DevTools performance recording + memory heap snapshot + network throttle.",
      "promptTemplate": "You are automating a workflow for Browser DevTools & Debugging. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with debugging workflow / breakpoint guide / performance recording / memory snapshot. Guard against: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Test with Chrome DevTools performance recording + memory heap snapshot + network throttle.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Browser DevTools & Debugging process\" — produce a reusable CLI that handles Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.",
        "\"Automate Browser DevTools & Debugging\" — create a dry-run mode and test with Chrome DevTools performance recording."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:browser-devtools",
          "workflow:script",
          "automation",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cli-tool-design-script",
      "name": "CLI Tool Design Patterns: Script",
      "category": "Automation",
      "description": "[CLI Tool Design Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "triggerPhrase": "Create a reusable automation for \"CLI Tool Design Patterns\". The task produces CLI scaffolding / argument parser / exit code handler / --json output mode. Handle the failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\". Include a dry-run mode and test with echo $? after CLI run + stderr redirection test + --json output validation.",
      "promptTemplate": "You are automating a workflow for CLI Tool Design Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with CLI scaffolding / argument parser / exit code handler / --json output mode. Guard against: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Test with echo $? after CLI run + stderr redirection test + --json output validation.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the CLI Tool Design Patterns process\" — produce a reusable CLI that handles Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.",
        "\"Automate CLI Tool Design Patterns\" — create a dry-run mode and test with echo $? after CLI run."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cli-tool-design",
          "workflow:script",
          "automation",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cloud-cost-optimization-script",
      "name": "Cloud Cost Optimisation: Script",
      "category": "Automation",
      "description": "[Cloud Cost Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "triggerPhrase": "Create a reusable automation for \"Cloud Cost Optimisation\". The task produces right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Handle the failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\". Include a dry-run mode and test with cloud cost explorer + instance utilisation report + auto-stop Lambda function test.",
      "promptTemplate": "You are automating a workflow for Cloud Cost Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Guard against: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Test with cloud cost explorer + instance utilisation report + auto-stop Lambda function test.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Cloud Cost Optimisation process\" — produce a reusable CLI that handles Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.",
        "\"Automate Cloud Cost Optimisation\" — create a dry-run mode and test with cloud cost explorer."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:script",
          "automation",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "code-review-checklist-script",
      "name": "Code Review Checklist: Script",
      "category": "Automation",
      "description": "[Code Review Checklist] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "triggerPhrase": "Create a reusable automation for \"Code Review Checklist\". The task produces review checklist / automated review comment / risk classification / diff summary. Handle the failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\". Include a dry-run mode and test with git diff --stat + lint-staged + danger.js automated review + commitlint.",
      "promptTemplate": "You are automating a workflow for Code Review Checklist. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with review checklist / automated review comment / risk classification / diff summary. Guard against: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Test with git diff --stat + lint-staged + danger.js automated review + commitlint.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Code Review Checklist process\" — produce a reusable CLI that handles Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.",
        "\"Automate Code Review Checklist\" — create a dry-run mode and test with git diff --stat."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:code-review-checklist",
          "workflow:script",
          "automation",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "convex-functions-script",
      "name": "Convex Functions & Mutations: Script",
      "category": "Automation",
      "description": "[Convex Functions & Mutations] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "triggerPhrase": "Create a reusable automation for \"Convex Functions & Mutations\". The task produces mutation / query / action / component / scheduler job. Handle the failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\". Include a dry-run mode and test with npx convex dev + dashboard OCC conflict log + custom retry logic.",
      "promptTemplate": "You are automating a workflow for Convex Functions & Mutations. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with mutation / query / action / component / scheduler job. Guard against: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Test with npx convex dev + dashboard OCC conflict log + custom retry logic.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific mutation / query / action / component / scheduler job this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Convex Functions & Mutations process\" — produce a reusable CLI that handles Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.",
        "\"Automate Convex Functions & Mutations\" — create a dry-run mode and test with npx convex dev."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:convex-functions",
          "workflow:script",
          "automation",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cron-job-reliability-script",
      "name": "Cron Job & Scheduled Task Reliability: Script",
      "category": "Automation",
      "description": "[Cron Job & Scheduled Task Reliability] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "triggerPhrase": "Create a reusable automation for \"Cron Job & Scheduled Task Reliability\". The task produces crontab entry / log rotation / idempotency guard / failure alert integration. Handle the failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\". Include a dry-run mode and test with tail -f /var/log/cron + systemctl status cron + idempotency test script.",
      "promptTemplate": "You are automating a workflow for Cron Job & Scheduled Task Reliability. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with crontab entry / log rotation / idempotency guard / failure alert integration. Guard against: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Test with tail -f /var/log/cron + systemctl status cron + idempotency test script.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Cron Job & Scheduled Task Reliability process\" — produce a reusable CLI that handles Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.",
        "\"Automate Cron Job & Scheduled Task Reliability\" — create a dry-run mode and test with tail -f /var/log/cron."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cron-job-reliability",
          "workflow:script",
          "automation",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "css-layout-script",
      "name": "CSS Layout & Responsiveness: Script",
      "category": "Automation",
      "description": "[CSS Layout & Responsiveness] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "triggerPhrase": "Create a reusable automation for \"CSS Layout & Responsiveness\". The task produces CSS layout refactor / responsive grid / container query implementation. Handle the failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\". Include a dry-run mode and test with Lighthouse mobile emulation + browser DevTools responsive mode.",
      "promptTemplate": "You are automating a workflow for CSS Layout & Responsiveness. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with CSS layout refactor / responsive grid / container query implementation. Guard against: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Test with Lighthouse mobile emulation + browser DevTools responsive mode.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the CSS Layout & Responsiveness process\" — produce a reusable CLI that handles Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.",
        "\"Automate CSS Layout & Responsiveness\" — create a dry-run mode and test with Lighthouse mobile emulation."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:css-layout",
          "workflow:script",
          "automation",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "csv-data-cleaning-script",
      "name": "CSV Data Cleaning Pipeline: Script",
      "category": "Automation",
      "description": "[CSV Data Cleaning Pipeline] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "triggerPhrase": "Create a reusable automation for \"CSV Data Cleaning Pipeline\". The task produces CSV parser / row validator / column type mapper / error report / cleaned output. Handle the failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\". Include a dry-run mode and test with python3 -c csv.DictReader + validation script + row count diff.",
      "promptTemplate": "You are automating a workflow for CSV Data Cleaning Pipeline. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with CSV parser / row validator / column type mapper / error report / cleaned output. Guard against: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Test with python3 -c csv.DictReader + validation script + row count diff.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the CSV Data Cleaning Pipeline process\" — produce a reusable CLI that handles Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.",
        "\"Automate CSV Data Cleaning Pipeline\" — create a dry-run mode and test with python3 -c csv.DictReader."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:script",
          "automation",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "database-migration-safety-script",
      "name": "Database Migration Safety: Script",
      "category": "Automation",
      "description": "[Database Migration Safety] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "triggerPhrase": "Create a reusable automation for \"Database Migration Safety\". The task produces batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Handle the failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\". Include a dry-run mode and test with pg_locks monitoring during migration + batch backfill script + rollback test.",
      "promptTemplate": "You are automating a workflow for Database Migration Safety. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Guard against: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Test with pg_locks monitoring during migration + batch backfill script + rollback test.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Database Migration Safety process\" — produce a reusable CLI that handles Running a long-running migration (e.",
        "\"Automate Database Migration Safety\" — create a dry-run mode and test with pg_locks monitoring during migration."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:database-migration-safety",
          "workflow:script",
          "automation",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "data-warehouse-schema-script",
      "name": "Data Warehouse Schema Design: Script",
      "category": "Automation",
      "description": "[Data Warehouse Schema Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "triggerPhrase": "Create a reusable automation for \"Data Warehouse Schema Design\". The task produces star schema / fact table / dimension table / ETL pipeline spec. Handle the failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\". Include a dry-run mode and test with dbt run + dbt test + query profiling with warehouse-native tools.",
      "promptTemplate": "You are automating a workflow for Data Warehouse Schema Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with star schema / fact table / dimension table / ETL pipeline spec. Guard against: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Test with dbt run + dbt test + query profiling with warehouse-native tools.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Data Warehouse Schema Design process\" — produce a reusable CLI that handles Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.",
        "\"Automate Data Warehouse Schema Design\" — create a dry-run mode and test with dbt run."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:script",
          "automation",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "design-token-system-script",
      "name": "Design Token Systems: Script",
      "category": "Automation",
      "description": "[Design Token Systems] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "triggerPhrase": "Create a reusable automation for \"Design Token Systems\". The task produces token JSON / CSS custom properties / theme switcher / token documentation. Handle the failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\". Include a dry-run mode and test with style-dictionary build + Storybook token viewer + token value comparison.",
      "promptTemplate": "You are automating a workflow for Design Token Systems. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with token JSON / CSS custom properties / theme switcher / token documentation. Guard against: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Test with style-dictionary build + Storybook token viewer + token value comparison.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Design Token Systems process\" — produce a reusable CLI that handles Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.",
        "\"Automate Design Token Systems\" — create a dry-run mode and test with style-dictionary build."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:design-token-system",
          "workflow:script",
          "automation",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-compose-networking-script",
      "name": "Docker Compose Networking: Script",
      "category": "Automation",
      "description": "[Docker Compose Networking] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "triggerPhrase": "Create a reusable automation for \"Docker Compose Networking\". The task produces docker-compose.yml / network config / healthcheck / depends_on condition. Handle the failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\". Include a dry-run mode and test with docker compose up --wait + docker network inspect + container logs.",
      "promptTemplate": "You are automating a workflow for Docker Compose Networking. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with docker-compose.yml / network config / healthcheck / depends_on condition. Guard against: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Test with docker compose up --wait + docker network inspect + container logs.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Docker Compose Networking process\" — produce a reusable CLI that handles Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.",
        "\"Automate Docker Compose Networking\" — create a dry-run mode and test with docker compose up --wait."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-compose-networking",
          "workflow:script",
          "automation",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-multistage-script",
      "name": "Docker Multi-Stage Builds: Script",
      "category": "Automation",
      "description": "[Docker Multi-Stage Builds] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "triggerPhrase": "Create a reusable automation for \"Docker Multi-Stage Builds\". The task produces multi-stage Dockerfile / .dockerignore / slim base image switch. Handle the failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\". Include a dry-run mode and test with docker build + docker scout + dive layer analysis.",
      "promptTemplate": "You are automating a workflow for Docker Multi-Stage Builds. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with multi-stage Dockerfile / .dockerignore / slim base image switch. Guard against: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Test with docker build + docker scout + dive layer analysis.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Docker Multi-Stage Builds process\" — produce a reusable CLI that handles Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.",
        "\"Automate Docker Multi-Stage Builds\" — create a dry-run mode and test with docker build."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-multistage",
          "workflow:script",
          "automation",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "drizzle-schema-design-script",
      "name": "Drizzle Schema Design: Script",
      "category": "Automation",
      "description": "[Drizzle Schema Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "triggerPhrase": "Create a reusable automation for \"Drizzle Schema Design\". The task produces schema.ts / relation map / migration SQL / Drizzle query builder. Handle the failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\". Include a dry-run mode and test with drizzle-kit push + drizzle-kit studio + generated SQL audit.",
      "promptTemplate": "You are automating a workflow for Drizzle Schema Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with schema.ts / relation map / migration SQL / Drizzle query builder. Guard against: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Test with drizzle-kit push + drizzle-kit studio + generated SQL audit.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Drizzle Schema Design process\" — produce a reusable CLI that handles Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.",
        "\"Automate Drizzle Schema Design\" — create a dry-run mode and test with drizzle-kit push."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:script",
          "automation",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "error-monitoring-setup-script",
      "name": "Error Monitoring & Alerting Setup: Script",
      "category": "Automation",
      "description": "[Error Monitoring & Alerting Setup] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "triggerPhrase": "Create a reusable automation for \"Error Monitoring & Alerting Setup\". The task produces Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Handle the failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\". Include a dry-run mode and test with Sentry API error list + alert rule test + source map validation.",
      "promptTemplate": "You are automating a workflow for Error Monitoring & Alerting Setup. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Guard against: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Test with Sentry API error list + alert rule test + source map validation.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Error Monitoring & Alerting Setup process\" — produce a reusable CLI that handles Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.",
        "\"Automate Error Monitoring & Alerting Setup\" — create a dry-run mode and test with Sentry API error list."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:script",
          "automation",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "fastapi-dependencies-script",
      "name": "FastAPI Dependency Injection: Script",
      "category": "Automation",
      "description": "[FastAPI Dependency Injection] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "triggerPhrase": "Create a reusable automation for \"FastAPI Dependency Injection\". The task produces dependency / lifespan handler / override for testing. Handle the failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\". Include a dry-run mode and test with uvicorn --reload + /docs interactive test + dependency graph visualisation.",
      "promptTemplate": "You are automating a workflow for FastAPI Dependency Injection. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with dependency / lifespan handler / override for testing. Guard against: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Test with uvicorn --reload + /docs interactive test + dependency graph visualisation.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific dependency / lifespan handler / override for testing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the FastAPI Dependency Injection process\" — produce a reusable CLI that handles Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.",
        "\"Automate FastAPI Dependency Injection\" — create a dry-run mode and test with uvicorn --reload."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:script",
          "automation",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "feature-flags-script",
      "name": "Feature Flags & Gradual Rollouts: Script",
      "category": "Automation",
      "description": "[Feature Flags & Gradual Rollouts] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "triggerPhrase": "Create a reusable automation for \"Feature Flags & Gradual Rollouts\". The task produces flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Handle the failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\". Include a dry-run mode and test with flag evaluation log + rollout percentage monitoring + unused flag scan.",
      "promptTemplate": "You are automating a workflow for Feature Flags & Gradual Rollouts. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Guard against: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Test with flag evaluation log + rollout percentage monitoring + unused flag scan.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Feature Flags & Gradual Rollouts process\" — produce a reusable CLI that handles Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.",
        "\"Automate Feature Flags & Gradual Rollouts\" — create a dry-run mode and test with flag evaluation log."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:feature-flags",
          "workflow:script",
          "automation",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "git-conflict-resolution-script",
      "name": "Git Conflict Resolution: Script",
      "category": "Automation",
      "description": "[Git Conflict Resolution] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "triggerPhrase": "Create a reusable automation for \"Git Conflict Resolution\". The task produces conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Handle the failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\". Include a dry-run mode and test with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere.",
      "promptTemplate": "You are automating a workflow for Git Conflict Resolution. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Guard against: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Test with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Git Conflict Resolution process\" — produce a reusable CLI that handles Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.",
        "\"Automate Git Conflict Resolution\" — create a dry-run mode and test with git log --oneline -5 -- <file>."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:script",
          "automation",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "github-actions-pipeline-script",
      "name": "GitHub Actions Pipeline Optimisation: Script",
      "category": "Automation",
      "description": "[GitHub Actions Pipeline Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "triggerPhrase": "Create a reusable automation for \"GitHub Actions Pipeline Optimisation\". The task produces workflow YAML / cache config / matrix build / conditional job execution. Handle the failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\". Include a dry-run mode and test with act --job test + cache hit/miss analysis + workflow graph visualisation.",
      "promptTemplate": "You are automating a workflow for GitHub Actions Pipeline Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with workflow YAML / cache config / matrix build / conditional job execution. Guard against: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Test with act --job test + cache hit/miss analysis + workflow graph visualisation.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the GitHub Actions Pipeline Optimisation process\" — produce a reusable CLI that handles Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.",
        "\"Automate GitHub Actions Pipeline Optimisation\" — create a dry-run mode and test with act --job test."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:script",
          "automation",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "graphql-n-plus-one-script",
      "name": "GraphQL N+1 Query Prevention: Script",
      "category": "Automation",
      "description": "[GraphQL N+1 Query Prevention] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "triggerPhrase": "Create a reusable automation for \"GraphQL N+1 Query Prevention\". The task produces DataLoader instance / batch load function / resolver refactor / query complexity analysis. Handle the failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\". Include a dry-run mode and test with graphql query with tracing + DataLoader statistics + SQL log analysis.",
      "promptTemplate": "You are automating a workflow for GraphQL N+1 Query Prevention. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with DataLoader instance / batch load function / resolver refactor / query complexity analysis. Guard against: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Test with graphql query with tracing + DataLoader statistics + SQL log analysis.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the GraphQL N+1 Query Prevention process\" — produce a reusable CLI that handles A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.",
        "\"Automate GraphQL N+1 Query Prevention\" — create a dry-run mode and test with graphql query with tracing."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:script",
          "automation",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "jest-test-optimization-script",
      "name": "Jest Test Optimisation: Script",
      "category": "Automation",
      "description": "[Jest Test Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "triggerPhrase": "Create a reusable automation for \"Jest Test Optimisation\". The task produces jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Handle the failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\". Include a dry-run mode and test with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check.",
      "promptTemplate": "You are automating a workflow for Jest Test Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Guard against: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Test with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Jest Test Optimisation process\" — produce a reusable CLI that handles Running the entire test suite on every change, taking minutes even for small incremental code changes.",
        "\"Automate Jest Test Optimisation\" — create a dry-run mode and test with jest --changedSince=main --json."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:jest-test-optimization",
          "workflow:script",
          "automation",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "json-schema-validation-script",
      "name": "JSON Schema Validation: Script",
      "category": "Automation",
      "description": "[JSON Schema Validation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "triggerPhrase": "Create a reusable automation for \"JSON Schema Validation\". The task produces JSON Schema / validator middleware / type guard / error message / response parser. Handle the failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\". Include a dry-run mode and test with ajv validate + JSON Schema test suite + response mock test.",
      "promptTemplate": "You are automating a workflow for JSON Schema Validation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with JSON Schema / validator middleware / type guard / error message / response parser. Guard against: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Test with ajv validate + JSON Schema test suite + response mock test.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the JSON Schema Validation process\" — produce a reusable CLI that handles Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.",
        "\"Automate JSON Schema Validation\" — create a dry-run mode and test with ajv validate."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:json-schema-validation",
          "workflow:script",
          "automation",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-hpa-script",
      "name": "Kubernetes Horizontal Pod Autoscaling: Script",
      "category": "Automation",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "triggerPhrase": "Create a reusable automation for \"Kubernetes Horizontal Pod Autoscaling\". The task produces HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Handle the failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\". Include a dry-run mode and test with kubectl get hpa --watch + kubectl top pods + metrics-server logs.",
      "promptTemplate": "You are automating a workflow for Kubernetes Horizontal Pod Autoscaling. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Guard against: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Test with kubectl get hpa --watch + kubectl top pods + metrics-server logs.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Kubernetes Horizontal Pod Autoscaling process\" — produce a reusable CLI that handles HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.",
        "\"Automate Kubernetes Horizontal Pod Autoscaling\" — create a dry-run mode and test with kubectl get hpa --watch."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:script",
          "automation",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-pod-lifecycle-script",
      "name": "Kubernetes Pod Lifecycle: Script",
      "category": "Automation",
      "description": "[Kubernetes Pod Lifecycle] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "triggerPhrase": "Create a reusable automation for \"Kubernetes Pod Lifecycle\". The task produces deployment.yaml / startup probe / readiness probe / liveness probe / init container. Handle the failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\". Include a dry-run mode and test with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'.",
      "promptTemplate": "You are automating a workflow for Kubernetes Pod Lifecycle. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with deployment.yaml / startup probe / readiness probe / liveness probe / init container. Guard against: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Test with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Kubernetes Pod Lifecycle process\" — produce a reusable CLI that handles Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.",
        "\"Automate Kubernetes Pod Lifecycle\" — create a dry-run mode and test with kubectl describe pod."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:script",
          "automation",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "context-window-budget-script",
      "name": "LLM Context Window Budget Management: Script",
      "category": "Automation",
      "description": "[LLM Context Window Budget Management] Create a reusable automation with idempotency, dry-run mode, and verification Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "triggerPhrase": "Create a reusable automation for \"LLM Context Window Budget Management\". The task produces trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Handle the failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\". Include a dry-run mode and test with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry.",
      "promptTemplate": "You are automating a workflow for LLM Context Window Budget Management. Create a reusable automation with idempotency, dry-run mode, and verification. The automation should produce or interact with trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Guard against: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Test with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "command",
          "name": "cmd",
          "description": "CMD output"
        }
      ],
      "examples": [
        "\"Script the LLM Context Window Budget Management process\" — produce a reusable CLI that handles Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content.",
        "\"Automate LLM Context Window Budget Management\" — create a dry-run mode and test with tiktoken count."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:context-window-budget",
          "workflow:script",
          "automation",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "mcp-tool-design-script",
      "name": "MCP Tool Design & Best Practices: Script",
      "category": "Automation",
      "description": "[MCP Tool Design & Best Practices] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "triggerPhrase": "Create a reusable automation for \"MCP Tool Design & Best Practices\". The task produces MCP tool descriptor / resource definition / prompt template / server metadata. Handle the failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\". Include a dry-run mode and test with mcp-cli run + mcp inspector + tool name conflict analysis.",
      "promptTemplate": "You are automating a workflow for MCP Tool Design & Best Practices. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with MCP tool descriptor / resource definition / prompt template / server metadata. Guard against: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Test with mcp-cli run + mcp inspector + tool name conflict analysis.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the MCP Tool Design & Best Practices process\" — produce a reusable CLI that handles Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.",
        "\"Automate MCP Tool Design & Best Practices\" — create a dry-run mode and test with mcp-cli run."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:mcp-tool-design",
          "workflow:script",
          "automation",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "message-queues-script",
      "name": "Message Queues & Background Jobs: Script",
      "category": "Automation",
      "description": "[Message Queues & Background Jobs] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "triggerPhrase": "Create a reusable automation for \"Message Queues & Background Jobs\". The task produces queue producer / worker / dead-letter handler / retry policy. Handle the failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\". Include a dry-run mode and test with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection.",
      "promptTemplate": "You are automating a workflow for Message Queues & Background Jobs. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with queue producer / worker / dead-letter handler / retry policy. Guard against: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Test with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Message Queues & Background Jobs process\" — produce a reusable CLI that handles Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.",
        "\"Automate Message Queues & Background Jobs\" — create a dry-run mode and test with Bull/BullMQ dashboard."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:message-queues",
          "workflow:script",
          "automation",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "multi-tenant-isolation-script",
      "name": "Multi-Tenant Data Isolation: Script",
      "category": "Automation",
      "description": "[Multi-Tenant Data Isolation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "triggerPhrase": "Create a reusable automation for \"Multi-Tenant Data Isolation\". The task produces RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Handle the failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\". Include a dry-run mode and test with RLS policy test with two different tenant sessions + data leakage check.",
      "promptTemplate": "You are automating a workflow for Multi-Tenant Data Isolation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Guard against: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Test with RLS policy test with two different tenant sessions + data leakage check.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Multi-Tenant Data Isolation process\" — produce a reusable CLI that handles Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.",
        "\"Automate Multi-Tenant Data Isolation\" — create a dry-run mode and test with RLS policy test with two different tenant sessions."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:script",
          "automation",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-api-routes-script",
      "name": "Next.js API Routes & Route Handlers: Script",
      "category": "Automation",
      "description": "[Next.js API Routes & Route Handlers] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "triggerPhrase": "Create a reusable automation for \"Next.js API Routes & Route Handlers\". The task produces route.ts handler / server action / API client wrapper / error boundary. Handle the failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\". Include a dry-run mode and test with curl --verbose + API route error log + status code audit.",
      "promptTemplate": "You are automating a workflow for Next.js API Routes & Route Handlers. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with route.ts handler / server action / API client wrapper / error boundary. Guard against: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Test with curl --verbose + API route error log + status code audit.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Next.js API Routes & Route Handlers process\" — produce a reusable CLI that handles Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.",
        "\"Automate Next.js API Routes & Route Handlers\" — create a dry-run mode and test with curl --verbose."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:script",
          "automation",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-data-fetching-script",
      "name": "Next.js Data Fetching Patterns: Script",
      "category": "Automation",
      "description": "[Next.js Data Fetching Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "triggerPhrase": "Create a reusable automation for \"Next.js Data Fetching Patterns\". The task produces server fetch / React cache wrapper / streaming suspense boundary. Handle the failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\". Include a dry-run mode and test with next build --debug + React DevTools fetch profiling.",
      "promptTemplate": "You are automating a workflow for Next.js Data Fetching Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with server fetch / React cache wrapper / streaming suspense boundary. Guard against: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Test with next build --debug + React DevTools fetch profiling.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Next.js Data Fetching Patterns process\" — produce a reusable CLI that handles Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.",
        "\"Automate Next.js Data Fetching Patterns\" — create a dry-run mode and test with next build --debug."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:script",
          "automation",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-middleware-script",
      "name": "Next.js Middleware & Edge Runtime: Script",
      "category": "Automation",
      "description": "[Next.js Middleware & Edge Runtime] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "triggerPhrase": "Create a reusable automation for \"Next.js Middleware & Edge Runtime\". The task produces middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Handle the failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\". Include a dry-run mode and test with next dev + curl --cookie tests + edge runtime log inspection.",
      "promptTemplate": "You are automating a workflow for Next.js Middleware & Edge Runtime. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Guard against: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Test with next dev + curl --cookie tests + edge runtime log inspection.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Next.js Middleware & Edge Runtime process\" — produce a reusable CLI that handles Using Node.",
        "\"Automate Next.js Middleware & Edge Runtime\" — create a dry-run mode and test with next dev."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-middleware",
          "workflow:script",
          "automation",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-error-handling-script",
      "name": "Node.js Error Handling & Resilience: Script",
      "category": "Automation",
      "description": "[Node.js Error Handling & Resilience] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "triggerPhrase": "Create a reusable automation for \"Node.js Error Handling & Resilience\". The task produces global error handler / async wrapper / structured error response / retry logic. Handle the failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\". Include a dry-run mode and test with node --unhandled-rejections=strict + process.on('uncaughtException') log.",
      "promptTemplate": "You are automating a workflow for Node.js Error Handling & Resilience. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with global error handler / async wrapper / structured error response / retry logic. Guard against: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Test with node --unhandled-rejections=strict + process.on('uncaughtException') log.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Node.js Error Handling & Resilience process\" — produce a reusable CLI that handles Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.",
        "\"Automate Node.js Error Handling & Resilience\" — create a dry-run mode and test with node --unhandled-rejections=strict."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-error-handling",
          "workflow:script",
          "automation",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-streams-script",
      "name": "Node.js Streams & Backpressure: Script",
      "category": "Automation",
      "description": "[Node.js Streams & Backpressure] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "triggerPhrase": "Create a reusable automation for \"Node.js Streams & Backpressure\". The task produces Readable/Writable stream / Transform / pipeline() refactor. Handle the failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\". Include a dry-run mode and test with Node.js --inspect memory heap snapshot + stream highWaterMark tuning.",
      "promptTemplate": "You are automating a workflow for Node.js Streams & Backpressure. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with Readable/Writable stream / Transform / pipeline() refactor. Guard against: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Test with Node.js --inspect memory heap snapshot + stream highWaterMark tuning.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Node.js Streams & Backpressure process\" — produce a reusable CLI that handles Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.",
        "\"Automate Node.js Streams & Backpressure\" — create a dry-run mode and test with Node.js --inspect memory heap snapshot."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-streams",
          "workflow:script",
          "automation",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "oauth-flows-script",
      "name": "OAuth 2.0 Flows & Token Management: Script",
      "category": "Automation",
      "description": "[OAuth 2.0 Flows & Token Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "triggerPhrase": "Create a reusable automation for \"OAuth 2.0 Flows & Token Management\". The task produces OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Handle the failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\". Include a dry-run mode and test with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection.",
      "promptTemplate": "You are automating a workflow for OAuth 2.0 Flows & Token Management. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Guard against: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Test with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the OAuth 2.0 Flows & Token Management process\" — produce a reusable CLI that handles Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.",
        "\"Automate OAuth 2.0 Flows & Token Management\" — create a dry-run mode and test with oauth2_proxy."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:oauth-flows",
          "workflow:script",
          "automation",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "openapi-spec-script",
      "name": "OpenAPI Specification & Validation: Script",
      "category": "Automation",
      "description": "[OpenAPI Specification & Validation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "triggerPhrase": "Create a reusable automation for \"OpenAPI Specification & Validation\". The task produces openapi.yaml / code-first generator / request/response validation middleware. Handle the failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\". Include a dry-run mode and test with redocly lint + openapi-diff + swagger-ui preview.",
      "promptTemplate": "You are automating a workflow for OpenAPI Specification & Validation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with openapi.yaml / code-first generator / request/response validation middleware. Guard against: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Test with redocly lint + openapi-diff + swagger-ui preview.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the OpenAPI Specification & Validation process\" — produce a reusable CLI that handles Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.",
        "\"Automate OpenAPI Specification & Validation\" — create a dry-run mode and test with redocly lint."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:openapi-spec",
          "workflow:script",
          "automation",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "playwright-selectors-script",
      "name": "Playwright Selectors & Locators: Script",
      "category": "Automation",
      "description": "[Playwright Selectors & Locators] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "triggerPhrase": "Create a reusable automation for \"Playwright Selectors & Locators\". The task produces locator refactor / test fixture / POM (Page Object Model) / custom fixture. Handle the failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\". Include a dry-run mode and test with playwright test --reporter=html + playwright codegen + trace viewer.",
      "promptTemplate": "You are automating a workflow for Playwright Selectors & Locators. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with locator refactor / test fixture / POM (Page Object Model) / custom fixture. Guard against: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Test with playwright test --reporter=html + playwright codegen + trace viewer.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Playwright Selectors & Locators process\" — produce a reusable CLI that handles Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.",
        "\"Automate Playwright Selectors & Locators\" — create a dry-run mode and test with playwright test --reporter=html."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:playwright-selectors",
          "workflow:script",
          "automation",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "prompt-injection-defense-script",
      "name": "Prompt Injection Defense: Script",
      "category": "Automation",
      "description": "[Prompt Injection Defense] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "triggerPhrase": "Create a reusable automation for \"Prompt Injection Defense\". The task produces defensive system prompt / input sanitizer / instruction guardrail / output validator. Handle the failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\". Include a dry-run mode and test with prompt injection test suite + adversarial input fuzzing + output scanner.",
      "promptTemplate": "You are automating a workflow for Prompt Injection Defense. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with defensive system prompt / input sanitizer / instruction guardrail / output validator. Guard against: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Test with prompt injection test suite + adversarial input fuzzing + output scanner.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Prompt Injection Defense process\" — produce a reusable CLI that handles Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.",
        "\"Automate Prompt Injection Defense\" — create a dry-run mode and test with prompt injection test suite."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:script",
          "automation",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-async-script",
      "name": "Python Async/Await Patterns: Script",
      "category": "Automation",
      "description": "[Python Async/Await Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "triggerPhrase": "Create a reusable automation for \"Python Async/Await Patterns\". The task produces async/await refactor / asyncio.gather / async context manager. Handle the failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\". Include a dry-run mode and test with python3 -m asyncio + aiohttp/httpx async benchmark.",
      "promptTemplate": "You are automating a workflow for Python Async/Await Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with async/await refactor / asyncio.gather / async context manager. Guard against: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Test with python3 -m asyncio + aiohttp/httpx async benchmark.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Python Async/Await Patterns process\" — produce a reusable CLI that handles Blocking the event loop by using synchronous requests or time.",
        "\"Automate Python Async/Await Patterns\" — create a dry-run mode and test with python3 -m asyncio."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-async",
          "workflow:script",
          "automation",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-file-io-script",
      "name": "Python File I/O & Encoding: Script",
      "category": "Automation",
      "description": "[Python File I/O & Encoding] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "triggerPhrase": "Create a reusable automation for \"Python File I/O & Encoding\". The task produces pathlib refactor / encoding-safe file reader / batch file processor. Handle the failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\". Include a dry-run mode and test with python3 -c with open() + chardet encoding detection.",
      "promptTemplate": "You are automating a workflow for Python File I/O & Encoding. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with pathlib refactor / encoding-safe file reader / batch file processor. Guard against: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Test with python3 -c with open() + chardet encoding detection.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Python File I/O & Encoding process\" — produce a reusable CLI that handles Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.",
        "\"Automate Python File I/O & Encoding\" — create a dry-run mode and test with python3 -c with open()."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-file-io",
          "workflow:script",
          "automation",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rag-chunking-script",
      "name": "RAG Chunking Strategies: Script",
      "category": "Automation",
      "description": "[RAG Chunking Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "triggerPhrase": "Create a reusable automation for \"RAG Chunking Strategies\". The task produces semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Handle the failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\". Include a dry-run mode and test with retrieval evaluation script + chunk boundary visualisation + recall@k measurement.",
      "promptTemplate": "You are automating a workflow for RAG Chunking Strategies. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Guard against: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Test with retrieval evaluation script + chunk boundary visualisation + recall@k measurement.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the RAG Chunking Strategies process\" — produce a reusable CLI that handles Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.",
        "\"Automate RAG Chunking Strategies\" — create a dry-run mode and test with retrieval evaluation script."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rag-chunking",
          "workflow:script",
          "automation",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rate-limiting-proxy-script",
      "name": "Rate Limiting & API Gateway Proxy: Script",
      "category": "Automation",
      "description": "[Rate Limiting & API Gateway Proxy] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "triggerPhrase": "Create a reusable automation for \"Rate Limiting & API Gateway Proxy\". The task produces NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Handle the failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\". Include a dry-run mode and test with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring.",
      "promptTemplate": "You are automating a workflow for Rate Limiting & API Gateway Proxy. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Guard against: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Test with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Rate Limiting & API Gateway Proxy process\" — produce a reusable CLI that handles Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.",
        "\"Automate Rate Limiting & API Gateway Proxy\" — create a dry-run mode and test with ab -n 1000 -c 10."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:script",
          "automation",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-server-components-script",
      "name": "React Server Components: Script",
      "category": "Automation",
      "description": "[React Server Components] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "triggerPhrase": "Create a reusable automation for \"React Server Components\". The task produces server component / client boundary refactor / streaming fallback. Handle the failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\". Include a dry-run mode and test with next build --debug + React Server Components lint rule.",
      "promptTemplate": "You are automating a workflow for React Server Components. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with server component / client boundary refactor / streaming fallback. Guard against: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Test with next build --debug + React Server Components lint rule.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the React Server Components process\" — produce a reusable CLI that handles Accidentally making a server component a client component by using hooks or event handlers in the wrong file.",
        "\"Automate React Server Components\" — create a dry-run mode and test with next build --debug."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-server-components",
          "workflow:script",
          "automation",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-state-script",
      "name": "React State Management: Script",
      "category": "Automation",
      "description": "[React State Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "triggerPhrase": "Create a reusable automation for \"React State Management\". The task produces useState / useReducer / useContext hook refactor, zustand or jotai store slice. Handle the failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\". Include a dry-run mode and test with React DevTools profiler + why-did-you-render.",
      "promptTemplate": "You are automating a workflow for React State Management. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with useState / useReducer / useContext hook refactor, zustand or jotai store slice. Guard against: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Test with React DevTools profiler + why-did-you-render.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the React State Management process\" — produce a reusable CLI that handles Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.",
        "\"Automate React State Management\" — create a dry-run mode and test with React DevTools profiler."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-state",
          "workflow:script",
          "automation",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "redis-caching-script",
      "name": "Redis Caching Strategies: Script",
      "category": "Automation",
      "description": "[Redis Caching Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "triggerPhrase": "Create a reusable automation for \"Redis Caching Strategies\". The task produces cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Handle the failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\". Include a dry-run mode and test with redis-cli --stat + cache hit ratio monitoring + slow log.",
      "promptTemplate": "You are automating a workflow for Redis Caching Strategies. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Guard against: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Test with redis-cli --stat + cache hit ratio monitoring + slow log.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Redis Caching Strategies process\" — produce a reusable CLI that handles Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.",
        "\"Automate Redis Caching Strategies\" — create a dry-run mode and test with redis-cli --stat."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:redis-caching",
          "workflow:script",
          "automation",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rest-pagination-script",
      "name": "REST Pagination Design: Script",
      "category": "Automation",
      "description": "[REST Pagination Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "triggerPhrase": "Create a reusable automation for \"REST Pagination Design\". The task produces cursor pagination / offset pagination fallback / total count optimisation / response envelope. Handle the failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\". Include a dry-run mode and test with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark.",
      "promptTemplate": "You are automating a workflow for REST Pagination Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with cursor pagination / offset pagination fallback / total count optimisation / response envelope. Guard against: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Test with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the REST Pagination Design process\" — produce a reusable CLI that handles Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.",
        "\"Automate REST Pagination Design\" — create a dry-run mode and test with curl with cursor param."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rest-pagination",
          "workflow:script",
          "automation",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "secrets-rotation-script",
      "name": "Secrets Rotation Policy: Script",
      "category": "Automation",
      "description": "[Secrets Rotation Policy] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "triggerPhrase": "Create a reusable automation for \"Secrets Rotation Policy\". The task produces rotation script / vault integration / lease management / incident response plan. Handle the failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\". Include a dry-run mode and test with vault lease list + secret expiry check + rotation dry-run test.",
      "promptTemplate": "You are automating a workflow for Secrets Rotation Policy. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with rotation script / vault integration / lease management / incident response plan. Guard against: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Test with vault lease list + secret expiry check + rotation dry-run test.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Secrets Rotation Policy process\" — produce a reusable CLI that handles Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.",
        "\"Automate Secrets Rotation Policy\" — create a dry-run mode and test with vault lease list."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:secrets-rotation",
          "workflow:script",
          "automation",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "shell-script-robustness-script",
      "name": "Shell Script Robustness & Safety: Script",
      "category": "Automation",
      "description": "[Shell Script Robustness & Safety] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "triggerPhrase": "Create a reusable automation for \"Shell Script Robustness & Safety\". The task produces set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Handle the failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\". Include a dry-run mode and test with shellcheck script.sh + bash -n script.sh + dry-run mode test.",
      "promptTemplate": "You are automating a workflow for Shell Script Robustness & Safety. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Guard against: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Test with shellcheck script.sh + bash -n script.sh + dry-run mode test.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Shell Script Robustness & Safety process\" — produce a reusable CLI that handles Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.",
        "\"Automate Shell Script Robustness & Safety\" — create a dry-run mode and test with shellcheck script.sh."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:shell-script-robustness",
          "workflow:script",
          "automation",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "sql-query-optimization-script",
      "name": "SQL Query Optimisation: Script",
      "category": "Automation",
      "description": "[SQL Query Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "triggerPhrase": "Create a reusable automation for \"SQL Query Optimisation\". The task produces indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Handle the failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\". Include a dry-run mode and test with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query.",
      "promptTemplate": "You are automating a workflow for SQL Query Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Guard against: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Test with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the SQL Query Optimisation process\" — produce a reusable CLI that handles Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.",
        "\"Automate SQL Query Optimisation\" — create a dry-run mode and test with EXPLAIN (ANALYSE, BUFFERS)."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:sql-query-optimization",
          "workflow:script",
          "automation",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stealth-web-research-script",
      "name": "Stealth Web Research & Harvesting: Script",
      "category": "Automation",
      "description": "[Stealth Web Research & Harvesting] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "triggerPhrase": "Create a reusable automation for \"Stealth Web Research & Harvesting\". The task produces clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Handle the failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\". Include a dry-run mode and test with playwright-extra + stealth + cheerio + defuddle + manual jq inspection.",
      "promptTemplate": "You are automating a workflow for Stealth Web Research & Harvesting. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Guard against: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Test with playwright-extra + stealth + cheerio + defuddle + manual jq inspection.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Stealth Web Research & Harvesting process\" — produce a reusable CLI that handles Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.",
        "\"Automate Stealth Web Research & Harvesting\" — create a dry-run mode and test with playwright-extra."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stealth-web-research",
          "workflow:script",
          "automation",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stripe-webhook-idempotency-script",
      "name": "Stripe Webhook Idempotency: Script",
      "category": "Automation",
      "description": "[Stripe Webhook Idempotency] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "triggerPhrase": "Create a reusable automation for \"Stripe Webhook Idempotency\". The task produces Webhook handler / idempotency key check / event deduplication / failed payment recovery. Handle the failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\". Include a dry-run mode and test with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check.",
      "promptTemplate": "You are automating a workflow for Stripe Webhook Idempotency. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with Webhook handler / idempotency key check / event deduplication / failed payment recovery. Guard against: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Test with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Stripe Webhook Idempotency process\" — produce a reusable CLI that handles Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.",
        "\"Automate Stripe Webhook Idempotency\" — create a dry-run mode and test with stripe trigger payment_intent.succeeded."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:script",
          "automation",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "supabase-rls-script",
      "name": "Supabase Row-Level Security: Script",
      "category": "Automation",
      "description": "[Supabase Row-Level Security] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "triggerPhrase": "Create a reusable automation for \"Supabase Row-Level Security\". The task produces RLS policy / policy test / security definer function / admin bypass. Handle the failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\". Include a dry-run mode and test with supabase db check + supabase db test + RLS policy review with pg_policies.",
      "promptTemplate": "You are automating a workflow for Supabase Row-Level Security. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with RLS policy / policy test / security definer function / admin bypass. Guard against: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Test with supabase db check + supabase db test + RLS policy review with pg_policies.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Supabase Row-Level Security process\" — produce a reusable CLI that handles RLS policies that are too permissive (using 'true' instead of 'auth.",
        "\"Automate Supabase Row-Level Security\" — create a dry-run mode and test with supabase db check."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:supabase-rls",
          "workflow:script",
          "automation",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "terraform-state-script",
      "name": "Terraform State Management: Script",
      "category": "Automation",
      "description": "[Terraform State Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "triggerPhrase": "Create a reusable automation for \"Terraform State Management\". The task produces backend config / state migration plan / state locking config / remote state datasource. Handle the failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\". Include a dry-run mode and test with terraform plan + terraform state list + terraform state pull | jq.",
      "promptTemplate": "You are automating a workflow for Terraform State Management. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with backend config / state migration plan / state locking config / remote state datasource. Guard against: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Test with terraform plan + terraform state list + terraform state pull | jq.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Terraform State Management process\" — produce a reusable CLI that handles Losing the .",
        "\"Automate Terraform State Management\" — create a dry-run mode and test with terraform plan."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:terraform-state",
          "workflow:script",
          "automation",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "typescript-generics-script",
      "name": "TypeScript Generics & Advanced Types: Script",
      "category": "Automation",
      "description": "[TypeScript Generics & Advanced Types] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "triggerPhrase": "Create a reusable automation for \"TypeScript Generics & Advanced Types\". The task produces generic type / conditional type / mapped type / branded type. Handle the failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\". Include a dry-run mode and test with tsc --noEmit --strict + type tests with expect-type.",
      "promptTemplate": "You are automating a workflow for TypeScript Generics & Advanced Types. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with generic type / conditional type / mapped type / branded type. Guard against: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Test with tsc --noEmit --strict + type tests with expect-type.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the TypeScript Generics & Advanced Types process\" — produce a reusable CLI that handles Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).",
        "\"Automate TypeScript Generics & Advanced Types\" — create a dry-run mode and test with tsc --noEmit --strict."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:typescript-generics",
          "workflow:script",
          "automation",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "user-onboarding-flow-script",
      "name": "User Onboarding Flow Design: Script",
      "category": "Automation",
      "description": "[User Onboarding Flow Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "triggerPhrase": "Create a reusable automation for \"User Onboarding Flow Design\". The task produces onboarding wizard / feature checklist / in-app guide / first-run experience spec. Handle the failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\". Include a dry-run mode and test with analytics funnel analysis + onboarding completion rate + drop-off heatmap.",
      "promptTemplate": "You are automating a workflow for User Onboarding Flow Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with onboarding wizard / feature checklist / in-app guide / first-run experience spec. Guard against: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Test with analytics funnel analysis + onboarding completion rate + drop-off heatmap.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the User Onboarding Flow Design process\" — produce a reusable CLI that handles Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.",
        "\"Automate User Onboarding Flow Design\" — create a dry-run mode and test with analytics funnel analysis."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:script",
          "automation",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "vercel-env-vars-script",
      "name": "Vercel Environment Variables: Script",
      "category": "Automation",
      "description": "[Vercel Environment Variables] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "triggerPhrase": "Create a reusable automation for \"Vercel Environment Variables\". The task produces vercel.json env group / preview env config / Edge Config / KV store. Handle the failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\". Include a dry-run mode and test with vercel env pull + vercel list + project settings audit.",
      "promptTemplate": "You are automating a workflow for Vercel Environment Variables. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with vercel.json env group / preview env config / Edge Config / KV store. Guard against: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Test with vercel env pull + vercel list + project settings audit.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Vercel Environment Variables process\" — produce a reusable CLI that handles Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.",
        "\"Automate Vercel Environment Variables\" — create a dry-run mode and test with vercel env pull."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:vercel-env-vars",
          "workflow:script",
          "automation",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-scraping-ethics-script",
      "name": "Web Scraping Ethics & Compliance: Script",
      "category": "Automation",
      "description": "[Web Scraping Ethics & Compliance] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "triggerPhrase": "Create a reusable automation for \"Web Scraping Ethics & Compliance\". The task produces robots.txt check / polite scraper / rate-limited crawler / cached scraper. Handle the failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\". Include a dry-run mode and test with curl robots.txt + wget --wait + scraper log audit.",
      "promptTemplate": "You are automating a workflow for Web Scraping Ethics & Compliance. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with robots.txt check / polite scraper / rate-limited crawler / cached scraper. Guard against: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Test with curl robots.txt + wget --wait + scraper log audit.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Web Scraping Ethics & Compliance process\" — produce a reusable CLI that handles Scraping a website that explicitly prohibits it in robots.",
        "\"Automate Web Scraping Ethics & Compliance\" — create a dry-run mode and test with curl robots.txt."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:script",
          "automation",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "websocket-reconnection-script",
      "name": "WebSocket Reconnection Strategies: Script",
      "category": "Automation",
      "description": "[WebSocket Reconnection Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "triggerPhrase": "Create a reusable automation for \"WebSocket Reconnection Strategies\". The task produces WebSocket client / reconnection logic / heartbeat / connection status component. Handle the failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\". Include a dry-run mode and test with Browser DevTools Network tab WS filter + reconnection test with server restart.",
      "promptTemplate": "You are automating a workflow for WebSocket Reconnection Strategies. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with WebSocket client / reconnection logic / heartbeat / connection status component. Guard against: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Test with Browser DevTools Network tab WS filter + reconnection test with server restart.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the WebSocket Reconnection Strategies process\" — produce a reusable CLI that handles Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.",
        "\"Automate WebSocket Reconnection Strategies\" — create a dry-run mode and test with Browser DevTools Network tab WS filter."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:websocket-reconnection",
          "workflow:script",
          "automation",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-vitals-optimization-script",
      "name": "Web Vitals Optimisation (LCP/CLS/INP): Script",
      "category": "Automation",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "triggerPhrase": "Create a reusable automation for \"Web Vitals Optimisation (LCP/CLS/INP)\". The task produces image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Handle the failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\". Include a dry-run mode and test with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension.",
      "promptTemplate": "You are automating a workflow for Web Vitals Optimisation (LCP/CLS/INP). Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Guard against: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Test with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Script the Web Vitals Optimisation (LCP/CLS/INP) process\" — produce a reusable CLI that handles Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).",
        "\"Automate Web Vitals Optimisation (LCP/CLS/INP)\" — create a dry-run mode and test with Lighthouse CI."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:script",
          "automation",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "memory-compressor",
      "name": "Memory Compressor",
      "category": "Context",
      "description": "Condenses a long agent session or conversation into a compact, lossless summary that preserves all decisions, code changes, risks, and next steps. Designed for handover between agents or sessions.",
      "triggerPhrase": "Call this when a session is becoming too long for the context window, when handing off to another agent, or when the user asks for a session summary.",
      "promptTemplate": "Scan the conversation chronologically. Extract: (1) decisions made and their rationale, (2) files created or modified (with diff summary), (3) open risks or unresolved questions, (4) verification commands run and their results, (5) explicit next steps. Format as a structured markdown document with headings. Omit chitchat, speculation, and redundant exploration. Preserve all exact file paths, function names, and command invocations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "transcript",
          "required": true,
          "description": "The full conversation or session log to compress."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        }
      ],
      "examples": [
        "Compress a 2-hour debugging session into a single-page handoff note for the next engineer.",
        "Summarise a multi-step refactor: original architecture, changes made, remaining work, and three test commands to validate the refactor."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "memory",
          "compression",
          "handoff"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a-b-testing-framework-diagnose",
      "name": "A/B Testing Framework: Diagnose",
      "category": "Diagnostics",
      "description": "[A/B Testing Framework] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "triggerPhrase": "Diagnose a problem in \"A/B Testing Framework\". The failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\" is a likely candidate. Isolate the root cause with minimal experiments. Use statsmodels sample size calculation + Bayesian A/B test + sequential testing for verification.",
      "promptTemplate": "You are diagnosing a failure in A/B Testing Framework. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Use statsmodels sample size calculation + Bayesian A/B test + sequential testing to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose A/B Testing Framework failure\" — run statsmodels sample size calculation and isolate root cause.",
        "\"Fix A/B Testing Framework error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:diagnose",
          "diagnostics",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a11y-aria-patterns-diagnose",
      "name": "Accessibility ARIA Patterns: Diagnose",
      "category": "Diagnostics",
      "description": "[Accessibility ARIA Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "triggerPhrase": "Diagnose a problem in \"Accessibility ARIA Patterns\". The failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\" is a likely candidate. Isolate the root cause with minimal experiments. Use axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit for verification.",
      "promptTemplate": "You are diagnosing a failure in Accessibility ARIA Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Use axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Accessibility ARIA Patterns failure\" — run axe-core and isolate root cause.",
        "\"Fix Accessibility ARIA Patterns error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:diagnose",
          "diagnostics",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "agent-tool-binding-diagnose",
      "name": "Agent Tool Binding & Dispatch: Diagnose",
      "category": "Diagnostics",
      "description": "[Agent Tool Binding & Dispatch] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "triggerPhrase": "Diagnose a problem in \"Agent Tool Binding & Dispatch\". The failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\" is a likely candidate. Isolate the root cause with minimal experiments. Use agent trace log + tool invocation frequency analysis + token cost audit for verification.",
      "promptTemplate": "You are diagnosing a failure in Agent Tool Binding & Dispatch. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Use agent trace log + tool invocation frequency analysis + token cost audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Agent Tool Binding & Dispatch failure\" — run agent trace log and isolate root cause.",
        "\"Fix Agent Tool Binding & Dispatch error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:agent-tool-binding",
          "workflow:diagnose",
          "diagnostics",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "analytics-metric-definition-diagnose",
      "name": "Analytics Metric Definitions: Diagnose",
      "category": "Diagnostics",
      "description": "[Analytics Metric Definitions] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "triggerPhrase": "Diagnose a problem in \"Analytics Metric Definitions\". The failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\" is a likely candidate. Isolate the root cause with minimal experiments. Use dbt docs generate + dbt test --select tag:metrics + metric comparison script for verification.",
      "promptTemplate": "You are diagnosing a failure in Analytics Metric Definitions. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Use dbt docs generate + dbt test --select tag:metrics + metric comparison script to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Analytics Metric Definitions failure\" — run dbt docs generate and isolate root cause.",
        "\"Fix Analytics Metric Definitions error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:diagnose",
          "diagnostics",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "adr-documentation-diagnose",
      "name": "Architecture Decision Records: Diagnose",
      "category": "Diagnostics",
      "description": "[Architecture Decision Records] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "triggerPhrase": "Diagnose a problem in \"Architecture Decision Records\". The failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\" is a likely candidate. Isolate the root cause with minimal experiments. Use adr-tools list + adr-tools generate + decision log index page for verification.",
      "promptTemplate": "You are diagnosing a failure in Architecture Decision Records. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Use adr-tools list + adr-tools generate + decision log index page to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ADR document / decision log / template / review workflow this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Architecture Decision Records failure\" — run adr-tools list and isolate root cause.",
        "\"Fix Architecture Decision Records error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:adr-documentation",
          "workflow:diagnose",
          "diagnostics",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "aws-lambda-cold-start-diagnose",
      "name": "AWS Lambda Cold Starts: Diagnose",
      "category": "Diagnostics",
      "description": "[AWS Lambda Cold Starts] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "triggerPhrase": "Diagnose a problem in \"AWS Lambda Cold Starts\". The failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\" is a likely candidate. Isolate the root cause with minimal experiments. Use AWS X-Ray trace + Lambda Insights + cold start dashboard for verification.",
      "promptTemplate": "You are diagnosing a failure in AWS Lambda Cold Starts. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Use AWS X-Ray trace + Lambda Insights + cold start dashboard to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose AWS Lambda Cold Starts failure\" — run AWS X-Ray trace and isolate root cause.",
        "\"Fix AWS Lambda Cold Starts error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:diagnose",
          "diagnostics",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "azure-bicep-diagnose",
      "name": "Azure Bicep Infrastructure: Diagnose",
      "category": "Diagnostics",
      "description": "[Azure Bicep Infrastructure] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "triggerPhrase": "Diagnose a problem in \"Azure Bicep Infrastructure\". The failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\" is a likely candidate. Isolate the root cause with minimal experiments. Use az deployment group validate + az what-if + bicep build for verification.",
      "promptTemplate": "You are diagnosing a failure in Azure Bicep Infrastructure. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Use az deployment group validate + az what-if + bicep build to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific main.bicep / module / parameter file / azd template this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Azure Bicep Infrastructure failure\" — run az deployment group validate and isolate root cause.",
        "\"Fix Azure Bicep Infrastructure error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:azure-bicep",
          "workflow:diagnose",
          "diagnostics",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "browser-devtools-diagnose",
      "name": "Browser DevTools & Debugging: Diagnose",
      "category": "Diagnostics",
      "description": "[Browser DevTools & Debugging] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "triggerPhrase": "Diagnose a problem in \"Browser DevTools & Debugging\". The failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Chrome DevTools performance recording + memory heap snapshot + network throttle for verification.",
      "promptTemplate": "You are diagnosing a failure in Browser DevTools & Debugging. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Use Chrome DevTools performance recording + memory heap snapshot + network throttle to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Browser DevTools & Debugging failure\" — run Chrome DevTools performance recording and isolate root cause.",
        "\"Fix Browser DevTools & Debugging error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:browser-devtools",
          "workflow:diagnose",
          "diagnostics",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cli-tool-design-diagnose",
      "name": "CLI Tool Design Patterns: Diagnose",
      "category": "Diagnostics",
      "description": "[CLI Tool Design Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "triggerPhrase": "Diagnose a problem in \"CLI Tool Design Patterns\". The failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\" is a likely candidate. Isolate the root cause with minimal experiments. Use echo $? after CLI run + stderr redirection test + --json output validation for verification.",
      "promptTemplate": "You are diagnosing a failure in CLI Tool Design Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Use echo $? after CLI run + stderr redirection test + --json output validation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose CLI Tool Design Patterns failure\" — run echo $? after CLI run and isolate root cause.",
        "\"Fix CLI Tool Design Patterns error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cli-tool-design",
          "workflow:diagnose",
          "diagnostics",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cloud-cost-optimization-diagnose",
      "name": "Cloud Cost Optimisation: Diagnose",
      "category": "Diagnostics",
      "description": "[Cloud Cost Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "triggerPhrase": "Diagnose a problem in \"Cloud Cost Optimisation\". The failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\" is a likely candidate. Isolate the root cause with minimal experiments. Use cloud cost explorer + instance utilisation report + auto-stop Lambda function test for verification.",
      "promptTemplate": "You are diagnosing a failure in Cloud Cost Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Use cloud cost explorer + instance utilisation report + auto-stop Lambda function test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Cloud Cost Optimisation failure\" — run cloud cost explorer and isolate root cause.",
        "\"Fix Cloud Cost Optimisation error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:diagnose",
          "diagnostics",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "code-review-checklist-diagnose",
      "name": "Code Review Checklist: Diagnose",
      "category": "Diagnostics",
      "description": "[Code Review Checklist] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "triggerPhrase": "Diagnose a problem in \"Code Review Checklist\". The failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\" is a likely candidate. Isolate the root cause with minimal experiments. Use git diff --stat + lint-staged + danger.js automated review + commitlint for verification.",
      "promptTemplate": "You are diagnosing a failure in Code Review Checklist. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Use git diff --stat + lint-staged + danger.js automated review + commitlint to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Code Review Checklist failure\" — run git diff --stat and isolate root cause.",
        "\"Fix Code Review Checklist error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:code-review-checklist",
          "workflow:diagnose",
          "diagnostics",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "convex-functions-diagnose",
      "name": "Convex Functions & Mutations: Diagnose",
      "category": "Diagnostics",
      "description": "[Convex Functions & Mutations] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "triggerPhrase": "Diagnose a problem in \"Convex Functions & Mutations\". The failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\" is a likely candidate. Isolate the root cause with minimal experiments. Use npx convex dev + dashboard OCC conflict log + custom retry logic for verification.",
      "promptTemplate": "You are diagnosing a failure in Convex Functions & Mutations. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Use npx convex dev + dashboard OCC conflict log + custom retry logic to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific mutation / query / action / component / scheduler job this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Convex Functions & Mutations failure\" — run npx convex dev and isolate root cause.",
        "\"Fix Convex Functions & Mutations error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:convex-functions",
          "workflow:diagnose",
          "diagnostics",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cron-job-reliability-diagnose",
      "name": "Cron Job & Scheduled Task Reliability: Diagnose",
      "category": "Diagnostics",
      "description": "[Cron Job & Scheduled Task Reliability] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "triggerPhrase": "Diagnose a problem in \"Cron Job & Scheduled Task Reliability\". The failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\" is a likely candidate. Isolate the root cause with minimal experiments. Use tail -f /var/log/cron + systemctl status cron + idempotency test script for verification.",
      "promptTemplate": "You are diagnosing a failure in Cron Job & Scheduled Task Reliability. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Use tail -f /var/log/cron + systemctl status cron + idempotency test script to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Cron Job & Scheduled Task Reliability failure\" — run tail -f /var/log/cron and isolate root cause.",
        "\"Fix Cron Job & Scheduled Task Reliability error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cron-job-reliability",
          "workflow:diagnose",
          "diagnostics",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "css-layout-diagnose",
      "name": "CSS Layout & Responsiveness: Diagnose",
      "category": "Diagnostics",
      "description": "[CSS Layout & Responsiveness] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "triggerPhrase": "Diagnose a problem in \"CSS Layout & Responsiveness\". The failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Lighthouse mobile emulation + browser DevTools responsive mode for verification.",
      "promptTemplate": "You are diagnosing a failure in CSS Layout & Responsiveness. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Use Lighthouse mobile emulation + browser DevTools responsive mode to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose CSS Layout & Responsiveness failure\" — run Lighthouse mobile emulation and isolate root cause.",
        "\"Fix CSS Layout & Responsiveness error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:css-layout",
          "workflow:diagnose",
          "diagnostics",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "csv-data-cleaning-diagnose",
      "name": "CSV Data Cleaning Pipeline: Diagnose",
      "category": "Diagnostics",
      "description": "[CSV Data Cleaning Pipeline] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "triggerPhrase": "Diagnose a problem in \"CSV Data Cleaning Pipeline\". The failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\" is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -c csv.DictReader + validation script + row count diff for verification.",
      "promptTemplate": "You are diagnosing a failure in CSV Data Cleaning Pipeline. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Use python3 -c csv.DictReader + validation script + row count diff to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose CSV Data Cleaning Pipeline failure\" — run python3 -c csv.DictReader and isolate root cause.",
        "\"Fix CSV Data Cleaning Pipeline error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:diagnose",
          "diagnostics",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "database-migration-safety-diagnose",
      "name": "Database Migration Safety: Diagnose",
      "category": "Diagnostics",
      "description": "[Database Migration Safety] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "triggerPhrase": "Diagnose a problem in \"Database Migration Safety\". The failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\" is a likely candidate. Isolate the root cause with minimal experiments. Use pg_locks monitoring during migration + batch backfill script + rollback test for verification.",
      "promptTemplate": "You are diagnosing a failure in Database Migration Safety. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Use pg_locks monitoring during migration + batch backfill script + rollback test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Database Migration Safety failure\" — run pg_locks monitoring during migration and isolate root cause.",
        "\"Fix Database Migration Safety error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:database-migration-safety",
          "workflow:diagnose",
          "diagnostics",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "data-warehouse-schema-diagnose",
      "name": "Data Warehouse Schema Design: Diagnose",
      "category": "Diagnostics",
      "description": "[Data Warehouse Schema Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "triggerPhrase": "Diagnose a problem in \"Data Warehouse Schema Design\". The failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\" is a likely candidate. Isolate the root cause with minimal experiments. Use dbt run + dbt test + query profiling with warehouse-native tools for verification.",
      "promptTemplate": "You are diagnosing a failure in Data Warehouse Schema Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Use dbt run + dbt test + query profiling with warehouse-native tools to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Data Warehouse Schema Design failure\" — run dbt run and isolate root cause.",
        "\"Fix Data Warehouse Schema Design error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:diagnose",
          "diagnostics",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "design-token-system-diagnose",
      "name": "Design Token Systems: Diagnose",
      "category": "Diagnostics",
      "description": "[Design Token Systems] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "triggerPhrase": "Diagnose a problem in \"Design Token Systems\". The failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\" is a likely candidate. Isolate the root cause with minimal experiments. Use style-dictionary build + Storybook token viewer + token value comparison for verification.",
      "promptTemplate": "You are diagnosing a failure in Design Token Systems. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Use style-dictionary build + Storybook token viewer + token value comparison to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Design Token Systems failure\" — run style-dictionary build and isolate root cause.",
        "\"Fix Design Token Systems error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:design-token-system",
          "workflow:diagnose",
          "diagnostics",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-compose-networking-diagnose",
      "name": "Docker Compose Networking: Diagnose",
      "category": "Diagnostics",
      "description": "[Docker Compose Networking] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "triggerPhrase": "Diagnose a problem in \"Docker Compose Networking\". The failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\" is a likely candidate. Isolate the root cause with minimal experiments. Use docker compose up --wait + docker network inspect + container logs for verification.",
      "promptTemplate": "You are diagnosing a failure in Docker Compose Networking. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Use docker compose up --wait + docker network inspect + container logs to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Docker Compose Networking failure\" — run docker compose up --wait and isolate root cause.",
        "\"Fix Docker Compose Networking error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-compose-networking",
          "workflow:diagnose",
          "diagnostics",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-multistage-diagnose",
      "name": "Docker Multi-Stage Builds: Diagnose",
      "category": "Diagnostics",
      "description": "[Docker Multi-Stage Builds] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "triggerPhrase": "Diagnose a problem in \"Docker Multi-Stage Builds\". The failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\" is a likely candidate. Isolate the root cause with minimal experiments. Use docker build + docker scout + dive layer analysis for verification.",
      "promptTemplate": "You are diagnosing a failure in Docker Multi-Stage Builds. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Use docker build + docker scout + dive layer analysis to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Docker Multi-Stage Builds failure\" — run docker build and isolate root cause.",
        "\"Fix Docker Multi-Stage Builds error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-multistage",
          "workflow:diagnose",
          "diagnostics",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "drizzle-schema-design-diagnose",
      "name": "Drizzle Schema Design: Diagnose",
      "category": "Diagnostics",
      "description": "[Drizzle Schema Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "triggerPhrase": "Diagnose a problem in \"Drizzle Schema Design\". The failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\" is a likely candidate. Isolate the root cause with minimal experiments. Use drizzle-kit push + drizzle-kit studio + generated SQL audit for verification.",
      "promptTemplate": "You are diagnosing a failure in Drizzle Schema Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Use drizzle-kit push + drizzle-kit studio + generated SQL audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Drizzle Schema Design failure\" — run drizzle-kit push and isolate root cause.",
        "\"Fix Drizzle Schema Design error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:diagnose",
          "diagnostics",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "error-monitoring-setup-diagnose",
      "name": "Error Monitoring & Alerting Setup: Diagnose",
      "category": "Diagnostics",
      "description": "[Error Monitoring & Alerting Setup] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "triggerPhrase": "Diagnose a problem in \"Error Monitoring & Alerting Setup\". The failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Sentry API error list + alert rule test + source map validation for verification.",
      "promptTemplate": "You are diagnosing a failure in Error Monitoring & Alerting Setup. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Use Sentry API error list + alert rule test + source map validation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Error Monitoring & Alerting Setup failure\" — run Sentry API error list and isolate root cause.",
        "\"Fix Error Monitoring & Alerting Setup error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:diagnose",
          "diagnostics",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "fastapi-dependencies-diagnose",
      "name": "FastAPI Dependency Injection: Diagnose",
      "category": "Diagnostics",
      "description": "[FastAPI Dependency Injection] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "triggerPhrase": "Diagnose a problem in \"FastAPI Dependency Injection\". The failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\" is a likely candidate. Isolate the root cause with minimal experiments. Use uvicorn --reload + /docs interactive test + dependency graph visualisation for verification.",
      "promptTemplate": "You are diagnosing a failure in FastAPI Dependency Injection. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Use uvicorn --reload + /docs interactive test + dependency graph visualisation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific dependency / lifespan handler / override for testing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose FastAPI Dependency Injection failure\" — run uvicorn --reload and isolate root cause.",
        "\"Fix FastAPI Dependency Injection error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:diagnose",
          "diagnostics",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "feature-flags-diagnose",
      "name": "Feature Flags & Gradual Rollouts: Diagnose",
      "category": "Diagnostics",
      "description": "[Feature Flags & Gradual Rollouts] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "triggerPhrase": "Diagnose a problem in \"Feature Flags & Gradual Rollouts\". The failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\" is a likely candidate. Isolate the root cause with minimal experiments. Use flag evaluation log + rollout percentage monitoring + unused flag scan for verification.",
      "promptTemplate": "You are diagnosing a failure in Feature Flags & Gradual Rollouts. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Use flag evaluation log + rollout percentage monitoring + unused flag scan to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Feature Flags & Gradual Rollouts failure\" — run flag evaluation log and isolate root cause.",
        "\"Fix Feature Flags & Gradual Rollouts error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:feature-flags",
          "workflow:diagnose",
          "diagnostics",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "git-conflict-resolution-diagnose",
      "name": "Git Conflict Resolution: Diagnose",
      "category": "Diagnostics",
      "description": "[Git Conflict Resolution] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "triggerPhrase": "Diagnose a problem in \"Git Conflict Resolution\". The failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\" is a likely candidate. Isolate the root cause with minimal experiments. Use git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere for verification.",
      "promptTemplate": "You are diagnosing a failure in Git Conflict Resolution. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Use git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Git Conflict Resolution failure\" — run git log --oneline -5 -- <file> and isolate root cause.",
        "\"Fix Git Conflict Resolution error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:diagnose",
          "diagnostics",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "github-actions-pipeline-diagnose",
      "name": "GitHub Actions Pipeline Optimisation: Diagnose",
      "category": "Diagnostics",
      "description": "[GitHub Actions Pipeline Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "triggerPhrase": "Diagnose a problem in \"GitHub Actions Pipeline Optimisation\". The failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\" is a likely candidate. Isolate the root cause with minimal experiments. Use act --job test + cache hit/miss analysis + workflow graph visualisation for verification.",
      "promptTemplate": "You are diagnosing a failure in GitHub Actions Pipeline Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Use act --job test + cache hit/miss analysis + workflow graph visualisation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose GitHub Actions Pipeline Optimisation failure\" — run act --job test and isolate root cause.",
        "\"Fix GitHub Actions Pipeline Optimisation error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:diagnose",
          "diagnostics",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "graphql-n-plus-one-diagnose",
      "name": "GraphQL N+1 Query Prevention: Diagnose",
      "category": "Diagnostics",
      "description": "[GraphQL N+1 Query Prevention] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "triggerPhrase": "Diagnose a problem in \"GraphQL N+1 Query Prevention\". The failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\" is a likely candidate. Isolate the root cause with minimal experiments. Use graphql query with tracing + DataLoader statistics + SQL log analysis for verification.",
      "promptTemplate": "You are diagnosing a failure in GraphQL N+1 Query Prevention. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Use graphql query with tracing + DataLoader statistics + SQL log analysis to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose GraphQL N+1 Query Prevention failure\" — run graphql query with tracing and isolate root cause.",
        "\"Fix GraphQL N+1 Query Prevention error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:diagnose",
          "diagnostics",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "jest-test-optimization-diagnose",
      "name": "Jest Test Optimisation: Diagnose",
      "category": "Diagnostics",
      "description": "[Jest Test Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "triggerPhrase": "Diagnose a problem in \"Jest Test Optimisation\". The failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\" is a likely candidate. Isolate the root cause with minimal experiments. Use jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check for verification.",
      "promptTemplate": "You are diagnosing a failure in Jest Test Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Use jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Jest Test Optimisation failure\" — run jest --changedSince=main --json and isolate root cause.",
        "\"Fix Jest Test Optimisation error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:jest-test-optimization",
          "workflow:diagnose",
          "diagnostics",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "json-schema-validation-diagnose",
      "name": "JSON Schema Validation: Diagnose",
      "category": "Diagnostics",
      "description": "[JSON Schema Validation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "triggerPhrase": "Diagnose a problem in \"JSON Schema Validation\". The failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\" is a likely candidate. Isolate the root cause with minimal experiments. Use ajv validate + JSON Schema test suite + response mock test for verification.",
      "promptTemplate": "You are diagnosing a failure in JSON Schema Validation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Use ajv validate + JSON Schema test suite + response mock test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose JSON Schema Validation failure\" — run ajv validate and isolate root cause.",
        "\"Fix JSON Schema Validation error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:json-schema-validation",
          "workflow:diagnose",
          "diagnostics",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-hpa-diagnose",
      "name": "Kubernetes Horizontal Pod Autoscaling: Diagnose",
      "category": "Diagnostics",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "triggerPhrase": "Diagnose a problem in \"Kubernetes Horizontal Pod Autoscaling\". The failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\" is a likely candidate. Isolate the root cause with minimal experiments. Use kubectl get hpa --watch + kubectl top pods + metrics-server logs for verification.",
      "promptTemplate": "You are diagnosing a failure in Kubernetes Horizontal Pod Autoscaling. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Use kubectl get hpa --watch + kubectl top pods + metrics-server logs to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Kubernetes Horizontal Pod Autoscaling failure\" — run kubectl get hpa --watch and isolate root cause.",
        "\"Fix Kubernetes Horizontal Pod Autoscaling error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:diagnose",
          "diagnostics",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-pod-lifecycle-diagnose",
      "name": "Kubernetes Pod Lifecycle: Diagnose",
      "category": "Diagnostics",
      "description": "[Kubernetes Pod Lifecycle] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "triggerPhrase": "Diagnose a problem in \"Kubernetes Pod Lifecycle\". The failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\" is a likely candidate. Isolate the root cause with minimal experiments. Use kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' for verification.",
      "promptTemplate": "You are diagnosing a failure in Kubernetes Pod Lifecycle. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Use kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Kubernetes Pod Lifecycle failure\" — run kubectl describe pod and isolate root cause.",
        "\"Fix Kubernetes Pod Lifecycle error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:diagnose",
          "diagnostics",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "context-window-budget-diagnose",
      "name": "LLM Context Window Budget Management: Diagnose",
      "category": "Diagnostics",
      "description": "[LLM Context Window Budget Management] Isolate root cause with minimal hypotheses and single-variable experiments Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "triggerPhrase": "Diagnose a problem in \"LLM Context Window Budget Management\". The failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\" is a likely candidate. Isolate the root cause with minimal experiments. Use tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry for verification.",
      "promptTemplate": "You are diagnosing a failure in LLM Context Window Budget Management. Isolate root cause with minimal hypotheses and single-variable experiments. The suspected failure pattern is: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Use tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "command",
          "name": "cmd",
          "description": "CMD output"
        }
      ],
      "examples": [
        "\"Diagnose LLM Context Window Budget Management failure\" — run tiktoken count and isolate root cause.",
        "\"Fix LLM Context Window Budget Management error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:context-window-budget",
          "workflow:diagnose",
          "diagnostics",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "mcp-tool-design-diagnose",
      "name": "MCP Tool Design & Best Practices: Diagnose",
      "category": "Diagnostics",
      "description": "[MCP Tool Design & Best Practices] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "triggerPhrase": "Diagnose a problem in \"MCP Tool Design & Best Practices\". The failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\" is a likely candidate. Isolate the root cause with minimal experiments. Use mcp-cli run + mcp inspector + tool name conflict analysis for verification.",
      "promptTemplate": "You are diagnosing a failure in MCP Tool Design & Best Practices. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Use mcp-cli run + mcp inspector + tool name conflict analysis to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose MCP Tool Design & Best Practices failure\" — run mcp-cli run and isolate root cause.",
        "\"Fix MCP Tool Design & Best Practices error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:mcp-tool-design",
          "workflow:diagnose",
          "diagnostics",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "message-queues-diagnose",
      "name": "Message Queues & Background Jobs: Diagnose",
      "category": "Diagnostics",
      "description": "[Message Queues & Background Jobs] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "triggerPhrase": "Diagnose a problem in \"Message Queues & Background Jobs\". The failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection for verification.",
      "promptTemplate": "You are diagnosing a failure in Message Queues & Background Jobs. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Use Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Message Queues & Background Jobs failure\" — run Bull/BullMQ dashboard and isolate root cause.",
        "\"Fix Message Queues & Background Jobs error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:message-queues",
          "workflow:diagnose",
          "diagnostics",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "multi-tenant-isolation-diagnose",
      "name": "Multi-Tenant Data Isolation: Diagnose",
      "category": "Diagnostics",
      "description": "[Multi-Tenant Data Isolation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "triggerPhrase": "Diagnose a problem in \"Multi-Tenant Data Isolation\". The failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\" is a likely candidate. Isolate the root cause with minimal experiments. Use RLS policy test with two different tenant sessions + data leakage check for verification.",
      "promptTemplate": "You are diagnosing a failure in Multi-Tenant Data Isolation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Use RLS policy test with two different tenant sessions + data leakage check to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Multi-Tenant Data Isolation failure\" — run RLS policy test with two different tenant sessions and isolate root cause.",
        "\"Fix Multi-Tenant Data Isolation error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:diagnose",
          "diagnostics",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-api-routes-diagnose",
      "name": "Next.js API Routes & Route Handlers: Diagnose",
      "category": "Diagnostics",
      "description": "[Next.js API Routes & Route Handlers] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "triggerPhrase": "Diagnose a problem in \"Next.js API Routes & Route Handlers\". The failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\" is a likely candidate. Isolate the root cause with minimal experiments. Use curl --verbose + API route error log + status code audit for verification.",
      "promptTemplate": "You are diagnosing a failure in Next.js API Routes & Route Handlers. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Use curl --verbose + API route error log + status code audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Next.js API Routes & Route Handlers failure\" — run curl --verbose and isolate root cause.",
        "\"Fix Next.js API Routes & Route Handlers error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:diagnose",
          "diagnostics",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-data-fetching-diagnose",
      "name": "Next.js Data Fetching Patterns: Diagnose",
      "category": "Diagnostics",
      "description": "[Next.js Data Fetching Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "triggerPhrase": "Diagnose a problem in \"Next.js Data Fetching Patterns\". The failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\" is a likely candidate. Isolate the root cause with minimal experiments. Use next build --debug + React DevTools fetch profiling for verification.",
      "promptTemplate": "You are diagnosing a failure in Next.js Data Fetching Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Use next build --debug + React DevTools fetch profiling to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Next.js Data Fetching Patterns failure\" — run next build --debug and isolate root cause.",
        "\"Fix Next.js Data Fetching Patterns error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:diagnose",
          "diagnostics",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-middleware-diagnose",
      "name": "Next.js Middleware & Edge Runtime: Diagnose",
      "category": "Diagnostics",
      "description": "[Next.js Middleware & Edge Runtime] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "triggerPhrase": "Diagnose a problem in \"Next.js Middleware & Edge Runtime\". The failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\" is a likely candidate. Isolate the root cause with minimal experiments. Use next dev + curl --cookie tests + edge runtime log inspection for verification.",
      "promptTemplate": "You are diagnosing a failure in Next.js Middleware & Edge Runtime. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Use next dev + curl --cookie tests + edge runtime log inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Next.js Middleware & Edge Runtime failure\" — run next dev and isolate root cause.",
        "\"Fix Next.js Middleware & Edge Runtime error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-middleware",
          "workflow:diagnose",
          "diagnostics",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-error-handling-diagnose",
      "name": "Node.js Error Handling & Resilience: Diagnose",
      "category": "Diagnostics",
      "description": "[Node.js Error Handling & Resilience] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "triggerPhrase": "Diagnose a problem in \"Node.js Error Handling & Resilience\". The failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\" is a likely candidate. Isolate the root cause with minimal experiments. Use node --unhandled-rejections=strict + process.on('uncaughtException') log for verification.",
      "promptTemplate": "You are diagnosing a failure in Node.js Error Handling & Resilience. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Use node --unhandled-rejections=strict + process.on('uncaughtException') log to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Node.js Error Handling & Resilience failure\" — run node --unhandled-rejections=strict and isolate root cause.",
        "\"Fix Node.js Error Handling & Resilience error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-error-handling",
          "workflow:diagnose",
          "diagnostics",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-streams-diagnose",
      "name": "Node.js Streams & Backpressure: Diagnose",
      "category": "Diagnostics",
      "description": "[Node.js Streams & Backpressure] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "triggerPhrase": "Diagnose a problem in \"Node.js Streams & Backpressure\". The failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Node.js --inspect memory heap snapshot + stream highWaterMark tuning for verification.",
      "promptTemplate": "You are diagnosing a failure in Node.js Streams & Backpressure. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Use Node.js --inspect memory heap snapshot + stream highWaterMark tuning to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Node.js Streams & Backpressure failure\" — run Node.js --inspect memory heap snapshot and isolate root cause.",
        "\"Fix Node.js Streams & Backpressure error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-streams",
          "workflow:diagnose",
          "diagnostics",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "oauth-flows-diagnose",
      "name": "OAuth 2.0 Flows & Token Management: Diagnose",
      "category": "Diagnostics",
      "description": "[OAuth 2.0 Flows & Token Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "triggerPhrase": "Diagnose a problem in \"OAuth 2.0 Flows & Token Management\". The failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\" is a likely candidate. Isolate the root cause with minimal experiments. Use oauth2_proxy + jwt.io debugger + curl --cookie with token inspection for verification.",
      "promptTemplate": "You are diagnosing a failure in OAuth 2.0 Flows & Token Management. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Use oauth2_proxy + jwt.io debugger + curl --cookie with token inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose OAuth 2.0 Flows & Token Management failure\" — run oauth2_proxy and isolate root cause.",
        "\"Fix OAuth 2.0 Flows & Token Management error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:oauth-flows",
          "workflow:diagnose",
          "diagnostics",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "openapi-spec-diagnose",
      "name": "OpenAPI Specification & Validation: Diagnose",
      "category": "Diagnostics",
      "description": "[OpenAPI Specification & Validation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "triggerPhrase": "Diagnose a problem in \"OpenAPI Specification & Validation\". The failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\" is a likely candidate. Isolate the root cause with minimal experiments. Use redocly lint + openapi-diff + swagger-ui preview for verification.",
      "promptTemplate": "You are diagnosing a failure in OpenAPI Specification & Validation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Use redocly lint + openapi-diff + swagger-ui preview to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose OpenAPI Specification & Validation failure\" — run redocly lint and isolate root cause.",
        "\"Fix OpenAPI Specification & Validation error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:openapi-spec",
          "workflow:diagnose",
          "diagnostics",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "playwright-selectors-diagnose",
      "name": "Playwright Selectors & Locators: Diagnose",
      "category": "Diagnostics",
      "description": "[Playwright Selectors & Locators] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "triggerPhrase": "Diagnose a problem in \"Playwright Selectors & Locators\". The failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\" is a likely candidate. Isolate the root cause with minimal experiments. Use playwright test --reporter=html + playwright codegen + trace viewer for verification.",
      "promptTemplate": "You are diagnosing a failure in Playwright Selectors & Locators. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Use playwright test --reporter=html + playwright codegen + trace viewer to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Playwright Selectors & Locators failure\" — run playwright test --reporter=html and isolate root cause.",
        "\"Fix Playwright Selectors & Locators error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:playwright-selectors",
          "workflow:diagnose",
          "diagnostics",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "prompt-injection-defense-diagnose",
      "name": "Prompt Injection Defense: Diagnose",
      "category": "Diagnostics",
      "description": "[Prompt Injection Defense] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "triggerPhrase": "Diagnose a problem in \"Prompt Injection Defense\". The failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\" is a likely candidate. Isolate the root cause with minimal experiments. Use prompt injection test suite + adversarial input fuzzing + output scanner for verification.",
      "promptTemplate": "You are diagnosing a failure in Prompt Injection Defense. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Use prompt injection test suite + adversarial input fuzzing + output scanner to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Prompt Injection Defense failure\" — run prompt injection test suite and isolate root cause.",
        "\"Fix Prompt Injection Defense error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:diagnose",
          "diagnostics",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-async-diagnose",
      "name": "Python Async/Await Patterns: Diagnose",
      "category": "Diagnostics",
      "description": "[Python Async/Await Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "triggerPhrase": "Diagnose a problem in \"Python Async/Await Patterns\". The failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\" is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -m asyncio + aiohttp/httpx async benchmark for verification.",
      "promptTemplate": "You are diagnosing a failure in Python Async/Await Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Use python3 -m asyncio + aiohttp/httpx async benchmark to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Python Async/Await Patterns failure\" — run python3 -m asyncio and isolate root cause.",
        "\"Fix Python Async/Await Patterns error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-async",
          "workflow:diagnose",
          "diagnostics",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-file-io-diagnose",
      "name": "Python File I/O & Encoding: Diagnose",
      "category": "Diagnostics",
      "description": "[Python File I/O & Encoding] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "triggerPhrase": "Diagnose a problem in \"Python File I/O & Encoding\". The failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\" is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -c with open() + chardet encoding detection for verification.",
      "promptTemplate": "You are diagnosing a failure in Python File I/O & Encoding. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Use python3 -c with open() + chardet encoding detection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Python File I/O & Encoding failure\" — run python3 -c with open() and isolate root cause.",
        "\"Fix Python File I/O & Encoding error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-file-io",
          "workflow:diagnose",
          "diagnostics",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rag-chunking-diagnose",
      "name": "RAG Chunking Strategies: Diagnose",
      "category": "Diagnostics",
      "description": "[RAG Chunking Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "triggerPhrase": "Diagnose a problem in \"RAG Chunking Strategies\". The failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\" is a likely candidate. Isolate the root cause with minimal experiments. Use retrieval evaluation script + chunk boundary visualisation + recall@k measurement for verification.",
      "promptTemplate": "You are diagnosing a failure in RAG Chunking Strategies. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Use retrieval evaluation script + chunk boundary visualisation + recall@k measurement to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose RAG Chunking Strategies failure\" — run retrieval evaluation script and isolate root cause.",
        "\"Fix RAG Chunking Strategies error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rag-chunking",
          "workflow:diagnose",
          "diagnostics",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rate-limiting-proxy-diagnose",
      "name": "Rate Limiting & API Gateway Proxy: Diagnose",
      "category": "Diagnostics",
      "description": "[Rate Limiting & API Gateway Proxy] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "triggerPhrase": "Diagnose a problem in \"Rate Limiting & API Gateway Proxy\". The failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\" is a likely candidate. Isolate the root cause with minimal experiments. Use ab -n 1000 -c 10 + nginx error log + 429 response code monitoring for verification.",
      "promptTemplate": "You are diagnosing a failure in Rate Limiting & API Gateway Proxy. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Use ab -n 1000 -c 10 + nginx error log + 429 response code monitoring to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Rate Limiting & API Gateway Proxy failure\" — run ab -n 1000 -c 10 and isolate root cause.",
        "\"Fix Rate Limiting & API Gateway Proxy error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:diagnose",
          "diagnostics",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-server-components-diagnose",
      "name": "React Server Components: Diagnose",
      "category": "Diagnostics",
      "description": "[React Server Components] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "triggerPhrase": "Diagnose a problem in \"React Server Components\". The failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\" is a likely candidate. Isolate the root cause with minimal experiments. Use next build --debug + React Server Components lint rule for verification.",
      "promptTemplate": "You are diagnosing a failure in React Server Components. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Use next build --debug + React Server Components lint rule to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose React Server Components failure\" — run next build --debug and isolate root cause.",
        "\"Fix React Server Components error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-server-components",
          "workflow:diagnose",
          "diagnostics",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-state-diagnose",
      "name": "React State Management: Diagnose",
      "category": "Diagnostics",
      "description": "[React State Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "triggerPhrase": "Diagnose a problem in \"React State Management\". The failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\" is a likely candidate. Isolate the root cause with minimal experiments. Use React DevTools profiler + why-did-you-render for verification.",
      "promptTemplate": "You are diagnosing a failure in React State Management. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Use React DevTools profiler + why-did-you-render to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose React State Management failure\" — run React DevTools profiler and isolate root cause.",
        "\"Fix React State Management error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-state",
          "workflow:diagnose",
          "diagnostics",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "redis-caching-diagnose",
      "name": "Redis Caching Strategies: Diagnose",
      "category": "Diagnostics",
      "description": "[Redis Caching Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "triggerPhrase": "Diagnose a problem in \"Redis Caching Strategies\". The failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\" is a likely candidate. Isolate the root cause with minimal experiments. Use redis-cli --stat + cache hit ratio monitoring + slow log for verification.",
      "promptTemplate": "You are diagnosing a failure in Redis Caching Strategies. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Use redis-cli --stat + cache hit ratio monitoring + slow log to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Redis Caching Strategies failure\" — run redis-cli --stat and isolate root cause.",
        "\"Fix Redis Caching Strategies error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:redis-caching",
          "workflow:diagnose",
          "diagnostics",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rest-pagination-diagnose",
      "name": "REST Pagination Design: Diagnose",
      "category": "Diagnostics",
      "description": "[REST Pagination Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "triggerPhrase": "Diagnose a problem in \"REST Pagination Design\". The failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\" is a likely candidate. Isolate the root cause with minimal experiments. Use curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark for verification.",
      "promptTemplate": "You are diagnosing a failure in REST Pagination Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Use curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose REST Pagination Design failure\" — run curl with cursor param and isolate root cause.",
        "\"Fix REST Pagination Design error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rest-pagination",
          "workflow:diagnose",
          "diagnostics",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "secrets-rotation-diagnose",
      "name": "Secrets Rotation Policy: Diagnose",
      "category": "Diagnostics",
      "description": "[Secrets Rotation Policy] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "triggerPhrase": "Diagnose a problem in \"Secrets Rotation Policy\". The failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\" is a likely candidate. Isolate the root cause with minimal experiments. Use vault lease list + secret expiry check + rotation dry-run test for verification.",
      "promptTemplate": "You are diagnosing a failure in Secrets Rotation Policy. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Use vault lease list + secret expiry check + rotation dry-run test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Secrets Rotation Policy failure\" — run vault lease list and isolate root cause.",
        "\"Fix Secrets Rotation Policy error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:secrets-rotation",
          "workflow:diagnose",
          "diagnostics",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "shell-script-robustness-diagnose",
      "name": "Shell Script Robustness & Safety: Diagnose",
      "category": "Diagnostics",
      "description": "[Shell Script Robustness & Safety] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "triggerPhrase": "Diagnose a problem in \"Shell Script Robustness & Safety\". The failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\" is a likely candidate. Isolate the root cause with minimal experiments. Use shellcheck script.sh + bash -n script.sh + dry-run mode test for verification.",
      "promptTemplate": "You are diagnosing a failure in Shell Script Robustness & Safety. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Use shellcheck script.sh + bash -n script.sh + dry-run mode test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Shell Script Robustness & Safety failure\" — run shellcheck script.sh and isolate root cause.",
        "\"Fix Shell Script Robustness & Safety error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:shell-script-robustness",
          "workflow:diagnose",
          "diagnostics",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "sql-query-optimization-diagnose",
      "name": "SQL Query Optimisation: Diagnose",
      "category": "Diagnostics",
      "description": "[SQL Query Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "triggerPhrase": "Diagnose a problem in \"SQL Query Optimisation\". The failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\" is a likely candidate. Isolate the root cause with minimal experiments. Use EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query for verification.",
      "promptTemplate": "You are diagnosing a failure in SQL Query Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Use EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose SQL Query Optimisation failure\" — run EXPLAIN (ANALYSE, BUFFERS) and isolate root cause.",
        "\"Fix SQL Query Optimisation error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:sql-query-optimization",
          "workflow:diagnose",
          "diagnostics",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stealth-web-research-diagnose",
      "name": "Stealth Web Research & Harvesting: Diagnose",
      "category": "Diagnostics",
      "description": "[Stealth Web Research & Harvesting] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "triggerPhrase": "Diagnose a problem in \"Stealth Web Research & Harvesting\". The failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\" is a likely candidate. Isolate the root cause with minimal experiments. Use playwright-extra + stealth + cheerio + defuddle + manual jq inspection for verification.",
      "promptTemplate": "You are diagnosing a failure in Stealth Web Research & Harvesting. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Use playwright-extra + stealth + cheerio + defuddle + manual jq inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Stealth Web Research & Harvesting failure\" — run playwright-extra and isolate root cause.",
        "\"Fix Stealth Web Research & Harvesting error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stealth-web-research",
          "workflow:diagnose",
          "diagnostics",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stripe-webhook-idempotency-diagnose",
      "name": "Stripe Webhook Idempotency: Diagnose",
      "category": "Diagnostics",
      "description": "[Stripe Webhook Idempotency] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "triggerPhrase": "Diagnose a problem in \"Stripe Webhook Idempotency\". The failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\" is a likely candidate. Isolate the root cause with minimal experiments. Use stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check for verification.",
      "promptTemplate": "You are diagnosing a failure in Stripe Webhook Idempotency. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Use stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Stripe Webhook Idempotency failure\" — run stripe trigger payment_intent.succeeded and isolate root cause.",
        "\"Fix Stripe Webhook Idempotency error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:diagnose",
          "diagnostics",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "supabase-rls-diagnose",
      "name": "Supabase Row-Level Security: Diagnose",
      "category": "Diagnostics",
      "description": "[Supabase Row-Level Security] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "triggerPhrase": "Diagnose a problem in \"Supabase Row-Level Security\". The failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\" is a likely candidate. Isolate the root cause with minimal experiments. Use supabase db check + supabase db test + RLS policy review with pg_policies for verification.",
      "promptTemplate": "You are diagnosing a failure in Supabase Row-Level Security. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Use supabase db check + supabase db test + RLS policy review with pg_policies to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Supabase Row-Level Security failure\" — run supabase db check and isolate root cause.",
        "\"Fix Supabase Row-Level Security error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:supabase-rls",
          "workflow:diagnose",
          "diagnostics",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "terraform-state-diagnose",
      "name": "Terraform State Management: Diagnose",
      "category": "Diagnostics",
      "description": "[Terraform State Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "triggerPhrase": "Diagnose a problem in \"Terraform State Management\". The failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\" is a likely candidate. Isolate the root cause with minimal experiments. Use terraform plan + terraform state list + terraform state pull | jq for verification.",
      "promptTemplate": "You are diagnosing a failure in Terraform State Management. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Use terraform plan + terraform state list + terraform state pull | jq to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Terraform State Management failure\" — run terraform plan and isolate root cause.",
        "\"Fix Terraform State Management error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:terraform-state",
          "workflow:diagnose",
          "diagnostics",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "typescript-generics-diagnose",
      "name": "TypeScript Generics & Advanced Types: Diagnose",
      "category": "Diagnostics",
      "description": "[TypeScript Generics & Advanced Types] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "triggerPhrase": "Diagnose a problem in \"TypeScript Generics & Advanced Types\". The failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\" is a likely candidate. Isolate the root cause with minimal experiments. Use tsc --noEmit --strict + type tests with expect-type for verification.",
      "promptTemplate": "You are diagnosing a failure in TypeScript Generics & Advanced Types. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Use tsc --noEmit --strict + type tests with expect-type to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose TypeScript Generics & Advanced Types failure\" — run tsc --noEmit --strict and isolate root cause.",
        "\"Fix TypeScript Generics & Advanced Types error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:typescript-generics",
          "workflow:diagnose",
          "diagnostics",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "user-onboarding-flow-diagnose",
      "name": "User Onboarding Flow Design: Diagnose",
      "category": "Diagnostics",
      "description": "[User Onboarding Flow Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "triggerPhrase": "Diagnose a problem in \"User Onboarding Flow Design\". The failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\" is a likely candidate. Isolate the root cause with minimal experiments. Use analytics funnel analysis + onboarding completion rate + drop-off heatmap for verification.",
      "promptTemplate": "You are diagnosing a failure in User Onboarding Flow Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Use analytics funnel analysis + onboarding completion rate + drop-off heatmap to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose User Onboarding Flow Design failure\" — run analytics funnel analysis and isolate root cause.",
        "\"Fix User Onboarding Flow Design error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:diagnose",
          "diagnostics",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "vercel-env-vars-diagnose",
      "name": "Vercel Environment Variables: Diagnose",
      "category": "Diagnostics",
      "description": "[Vercel Environment Variables] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "triggerPhrase": "Diagnose a problem in \"Vercel Environment Variables\". The failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\" is a likely candidate. Isolate the root cause with minimal experiments. Use vercel env pull + vercel list + project settings audit for verification.",
      "promptTemplate": "You are diagnosing a failure in Vercel Environment Variables. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Use vercel env pull + vercel list + project settings audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Vercel Environment Variables failure\" — run vercel env pull and isolate root cause.",
        "\"Fix Vercel Environment Variables error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:vercel-env-vars",
          "workflow:diagnose",
          "diagnostics",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-scraping-ethics-diagnose",
      "name": "Web Scraping Ethics & Compliance: Diagnose",
      "category": "Diagnostics",
      "description": "[Web Scraping Ethics & Compliance] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "triggerPhrase": "Diagnose a problem in \"Web Scraping Ethics & Compliance\". The failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\" is a likely candidate. Isolate the root cause with minimal experiments. Use curl robots.txt + wget --wait + scraper log audit for verification.",
      "promptTemplate": "You are diagnosing a failure in Web Scraping Ethics & Compliance. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Use curl robots.txt + wget --wait + scraper log audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Web Scraping Ethics & Compliance failure\" — run curl robots.txt and isolate root cause.",
        "\"Fix Web Scraping Ethics & Compliance error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:diagnose",
          "diagnostics",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "websocket-reconnection-diagnose",
      "name": "WebSocket Reconnection Strategies: Diagnose",
      "category": "Diagnostics",
      "description": "[WebSocket Reconnection Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "triggerPhrase": "Diagnose a problem in \"WebSocket Reconnection Strategies\". The failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Browser DevTools Network tab WS filter + reconnection test with server restart for verification.",
      "promptTemplate": "You are diagnosing a failure in WebSocket Reconnection Strategies. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Use Browser DevTools Network tab WS filter + reconnection test with server restart to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose WebSocket Reconnection Strategies failure\" — run Browser DevTools Network tab WS filter and isolate root cause.",
        "\"Fix WebSocket Reconnection Strategies error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:websocket-reconnection",
          "workflow:diagnose",
          "diagnostics",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-vitals-optimization-diagnose",
      "name": "Web Vitals Optimisation (LCP/CLS/INP): Diagnose",
      "category": "Diagnostics",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "triggerPhrase": "Diagnose a problem in \"Web Vitals Optimisation (LCP/CLS/INP)\". The failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\" is a likely candidate. Isolate the root cause with minimal experiments. Use Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension for verification.",
      "promptTemplate": "You are diagnosing a failure in Web Vitals Optimisation (LCP/CLS/INP). Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Use Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Diagnose Web Vitals Optimisation (LCP/CLS/INP) failure\" — run Lighthouse CI and isolate root cause.",
        "\"Fix Web Vitals Optimisation (LCP/CLS/INP) error\" — confirm hypothesis with a single verification command before applying a permanent fix."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:diagnose",
          "diagnostics",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a-b-testing-framework-explain",
      "name": "A/B Testing Framework: Explain",
      "category": "Docs",
      "description": "[A/B Testing Framework] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "triggerPhrase": "Write documentation for \"A/B Testing Framework\". Cover: what it is, when to use it, the Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise. pitfall, and how to verify with statsmodels sample size calculation + Bayesian A/B test + sequential testing. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting A/B Testing Framework. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (experiment spec / variant assignment / metric definition / statistical analysis script), the common failure pattern (Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.), the best practice (Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.), and the verification command (statsmodels sample size calculation + Bayesian A/B test + sequential testing).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document experiment spec / variant assignment / metric definition / statistical analysis script\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain A/B Testing Framework architecture\" — produce an ADR covering Use an online sample size calculator before starting the test."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:explain",
          "docs",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a11y-aria-patterns-explain",
      "name": "Accessibility ARIA Patterns: Explain",
      "category": "Docs",
      "description": "[Accessibility ARIA Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "triggerPhrase": "Write documentation for \"Accessibility ARIA Patterns\". Cover: what it is, when to use it, the Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers. pitfall, and how to verify with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Accessibility ARIA Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (ARIA attribute refactor / keyboard navigation / focus management / screen reader test script), the common failure pattern (Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.), the best practice (Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.), and the verification command (axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document ARIA attribute refactor / keyboard navigation / focus management / screen reader test script\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Accessibility ARIA Patterns architecture\" — produce an ADR covering Use native HTML elements whenever possible."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:explain",
          "docs",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "agent-tool-binding-explain",
      "name": "Agent Tool Binding & Dispatch: Explain",
      "category": "Docs",
      "description": "[Agent Tool Binding & Dispatch] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "triggerPhrase": "Write documentation for \"Agent Tool Binding & Dispatch\". Cover: what it is, when to use it, the Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly. pitfall, and how to verify with agent trace log + tool invocation frequency analysis + token cost audit. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Agent Tool Binding & Dispatch. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (router tool / domain group / dynamic tool injection / tool usage statistics), the common failure pattern (Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.), the best practice (Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.), and the verification command (agent trace log + tool invocation frequency analysis + token cost audit).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document router tool / domain group / dynamic tool injection / tool usage statistics\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Agent Tool Binding & Dispatch architecture\" — produce an ADR covering Group tools by domain and offer a 'router' tool first."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:agent-tool-binding",
          "workflow:explain",
          "docs",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "analytics-metric-definition-explain",
      "name": "Analytics Metric Definitions: Explain",
      "category": "Docs",
      "description": "[Analytics Metric Definitions] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "triggerPhrase": "Write documentation for \"Analytics Metric Definitions\". Cover: what it is, when to use it, the Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers. pitfall, and how to verify with dbt docs generate + dbt test --select tag:metrics + metric comparison script. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Analytics Metric Definitions. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (metric definition / dbt model / SQL logic / dashboard tile / documentation), the common failure pattern (Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.), the best practice (Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.), and the verification command (dbt docs generate + dbt test --select tag:metrics + metric comparison script).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document metric definition / dbt model / SQL logic / dashboard tile / documentation\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Analytics Metric Definitions architecture\" — produce an ADR covering Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:explain",
          "docs",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "adr-documentation-explain",
      "name": "Architecture Decision Records: Explain",
      "category": "Docs",
      "description": "[Architecture Decision Records] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "triggerPhrase": "Write documentation for \"Architecture Decision Records\". Cover: what it is, when to use it, the Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done. pitfall, and how to verify with adr-tools list + adr-tools generate + decision log index page. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Architecture Decision Records. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (ADR document / decision log / template / review workflow), the common failure pattern (Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.), the best practice (Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.), and the verification command (adr-tools list + adr-tools generate + decision log index page).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ADR document / decision log / template / review workflow this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document ADR document / decision log / template / review workflow\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Architecture Decision Records architecture\" — produce an ADR covering Write an ADR for every non-trivial decision."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:adr-documentation",
          "workflow:explain",
          "docs",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "aws-lambda-cold-start-explain",
      "name": "AWS Lambda Cold Starts: Explain",
      "category": "Docs",
      "description": "[AWS Lambda Cold Starts] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "triggerPhrase": "Write documentation for \"AWS Lambda Cold Starts\". Cover: what it is, when to use it, the Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler. pitfall, and how to verify with AWS X-Ray trace + Lambda Insights + cold start dashboard. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting AWS Lambda Cold Starts. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (handler refactor / SnapStart config / Provisioned Concurrency / warmer function), the common failure pattern (Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.), the best practice (Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.), and the verification command (AWS X-Ray trace + Lambda Insights + cold start dashboard).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document handler refactor / SnapStart config / Provisioned Concurrency / warmer function\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain AWS Lambda Cold Starts architecture\" — produce an ADR covering Move initialisation (DB connections, config loading) outside the handler."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:explain",
          "docs",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "azure-bicep-explain",
      "name": "Azure Bicep Infrastructure: Explain",
      "category": "Docs",
      "description": "[Azure Bicep Infrastructure] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "triggerPhrase": "Write documentation for \"Azure Bicep Infrastructure\". Cover: what it is, when to use it, the Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce. pitfall, and how to verify with az deployment group validate + az what-if + bicep build. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Azure Bicep Infrastructure. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (main.bicep / module / parameter file / azd template), the common failure pattern (Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.), the best practice (Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.), and the verification command (az deployment group validate + az what-if + bicep build).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific main.bicep / module / parameter file / azd template this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document main.bicep / module / parameter file / azd template\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Azure Bicep Infrastructure architecture\" — produce an ADR covering Always define Azure resources in Bicep or Terraform."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:azure-bicep",
          "workflow:explain",
          "docs",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "browser-devtools-explain",
      "name": "Browser DevTools & Debugging: Explain",
      "category": "Docs",
      "description": "[Browser DevTools & Debugging] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "triggerPhrase": "Write documentation for \"Browser DevTools & Debugging\". Cover: what it is, when to use it, the Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically. pitfall, and how to verify with Chrome DevTools performance recording + memory heap snapshot + network throttle. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Browser DevTools & Debugging. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (debugging workflow / breakpoint guide / performance recording / memory snapshot), the common failure pattern (Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.), the best practice (Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.), and the verification command (Chrome DevTools performance recording + memory heap snapshot + network throttle).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document debugging workflow / breakpoint guide / performance recording / memory snapshot\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Browser DevTools & Debugging architecture\" — produce an ADR covering Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:browser-devtools",
          "workflow:explain",
          "docs",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cli-tool-design-explain",
      "name": "CLI Tool Design Patterns: Explain",
      "category": "Docs",
      "description": "[CLI Tool Design Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "triggerPhrase": "Write documentation for \"CLI Tool Design Patterns\". Cover: what it is, when to use it, the Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with. pitfall, and how to verify with echo $? after CLI run + stderr redirection test + --json output validation. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting CLI Tool Design Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (CLI scaffolding / argument parser / exit code handler / --json output mode), the common failure pattern (Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.), the best practice (Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.), and the verification command (echo $? after CLI run + stderr redirection test + --json output validation).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document CLI scaffolding / argument parser / exit code handler / --json output mode\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain CLI Tool Design Patterns architecture\" — produce an ADR covering Always exit 0 on success, non-zero on failure."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cli-tool-design",
          "workflow:explain",
          "docs",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cloud-cost-optimization-explain",
      "name": "Cloud Cost Optimisation: Explain",
      "category": "Docs",
      "description": "[Cloud Cost Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "triggerPhrase": "Write documentation for \"Cloud Cost Optimisation\". Cover: what it is, when to use it, the Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours. pitfall, and how to verify with cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Cloud Cost Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report), the common failure pattern (Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.), the best practice (Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.), and the verification command (cloud cost explorer + instance utilisation report + auto-stop Lambda function test).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Cloud Cost Optimisation architecture\" — produce an ADR covering Right-size instances based on actual usage metrics (not peak theoretical load)."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:explain",
          "docs",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "code-review-checklist-explain",
      "name": "Code Review Checklist: Explain",
      "category": "Docs",
      "description": "[Code Review Checklist] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "triggerPhrase": "Write documentation for \"Code Review Checklist\". Cover: what it is, when to use it, the Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions. pitfall, and how to verify with git diff --stat + lint-staged + danger.js automated review + commitlint. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Code Review Checklist. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (review checklist / automated review comment / risk classification / diff summary), the common failure pattern (Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.), the best practice (Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.), and the verification command (git diff --stat + lint-staged + danger.js automated review + commitlint).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document review checklist / automated review comment / risk classification / diff summary\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Code Review Checklist architecture\" — produce an ADR covering Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:code-review-checklist",
          "workflow:explain",
          "docs",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "convex-functions-explain",
      "name": "Convex Functions & Mutations: Explain",
      "category": "Docs",
      "description": "[Convex Functions & Mutations] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "triggerPhrase": "Write documentation for \"Convex Functions & Mutations\". Cover: what it is, when to use it, the Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients. pitfall, and how to verify with npx convex dev + dashboard OCC conflict log + custom retry logic. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Convex Functions & Mutations. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (mutation / query / action / component / scheduler job), the common failure pattern (Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.), the best practice (Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.), and the verification command (npx convex dev + dashboard OCC conflict log + custom retry logic).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific mutation / query / action / component / scheduler job this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document mutation / query / action / component / scheduler job\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Convex Functions & Mutations architecture\" — produce an ADR covering Use patch() for partial updates and batch mutations for atomic multi-document writes."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:convex-functions",
          "workflow:explain",
          "docs",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cron-job-reliability-explain",
      "name": "Cron Job & Scheduled Task Reliability: Explain",
      "category": "Docs",
      "description": "[Cron Job & Scheduled Task Reliability] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "triggerPhrase": "Write documentation for \"Cron Job & Scheduled Task Reliability\". Cover: what it is, when to use it, the Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time. pitfall, and how to verify with tail -f /var/log/cron + systemctl status cron + idempotency test script. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Cron Job & Scheduled Task Reliability. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (crontab entry / log rotation / idempotency guard / failure alert integration), the common failure pattern (Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.), the best practice (Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.), and the verification command (tail -f /var/log/cron + systemctl status cron + idempotency test script).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document crontab entry / log rotation / idempotency guard / failure alert integration\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Cron Job & Scheduled Task Reliability architecture\" — produce an ADR covering Redirect cron output to a log file with timestamp."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cron-job-reliability",
          "workflow:explain",
          "docs",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "css-layout-explain",
      "name": "CSS Layout & Responsiveness: Explain",
      "category": "Docs",
      "description": "[CSS Layout & Responsiveness] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "triggerPhrase": "Write documentation for \"CSS Layout & Responsiveness\". Cover: what it is, when to use it, the Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable. pitfall, and how to verify with Lighthouse mobile emulation + browser DevTools responsive mode. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting CSS Layout & Responsiveness. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (CSS layout refactor / responsive grid / container query implementation), the common failure pattern (Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.), the best practice (Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.), and the verification command (Lighthouse mobile emulation + browser DevTools responsive mode).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document CSS layout refactor / responsive grid / container query implementation\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain CSS Layout & Responsiveness architecture\" — produce an ADR covering Design for the content, not the viewport."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:css-layout",
          "workflow:explain",
          "docs",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "csv-data-cleaning-explain",
      "name": "CSV Data Cleaning Pipeline: Explain",
      "category": "Docs",
      "description": "[CSV Data Cleaning Pipeline] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "triggerPhrase": "Write documentation for \"CSV Data Cleaning Pipeline\". Cover: what it is, when to use it, the Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines. pitfall, and how to verify with python3 -c csv.DictReader + validation script + row count diff. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting CSV Data Cleaning Pipeline. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (CSV parser / row validator / column type mapper / error report / cleaned output), the common failure pattern (Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.), the best practice (Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.), and the verification command (python3 -c csv.DictReader + validation script + row count diff).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document CSV parser / row validator / column type mapper / error report / cleaned output\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain CSV Data Cleaning Pipeline architecture\" — produce an ADR covering Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:explain",
          "docs",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "database-migration-safety-explain",
      "name": "Database Migration Safety: Explain",
      "category": "Docs",
      "description": "[Database Migration Safety] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "triggerPhrase": "Write documentation for \"Database Migration Safety\". Cover: what it is, when to use it, the Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users. pitfall, and how to verify with pg_locks monitoring during migration + batch backfill script + rollback test. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Database Migration Safety. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (batch migration / expand-contract pattern / zero-downtime migration / rollback plan), the common failure pattern (Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.), the best practice (Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.), and the verification command (pg_locks monitoring during migration + batch backfill script + rollback test).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document batch migration / expand-contract pattern / zero-downtime migration / rollback plan\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Database Migration Safety architecture\" — produce an ADR covering Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:database-migration-safety",
          "workflow:explain",
          "docs",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "data-warehouse-schema-explain",
      "name": "Data Warehouse Schema Design: Explain",
      "category": "Docs",
      "description": "[Data Warehouse Schema Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "triggerPhrase": "Write documentation for \"Data Warehouse Schema Design\". Cover: what it is, when to use it, the Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries. pitfall, and how to verify with dbt run + dbt test + query profiling with warehouse-native tools. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Data Warehouse Schema Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (star schema / fact table / dimension table / ETL pipeline spec), the common failure pattern (Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.), the best practice (Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.), and the verification command (dbt run + dbt test + query profiling with warehouse-native tools).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document star schema / fact table / dimension table / ETL pipeline spec\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Data Warehouse Schema Design architecture\" — produce an ADR covering Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:explain",
          "docs",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "design-token-system-explain",
      "name": "Design Token Systems: Explain",
      "category": "Docs",
      "description": "[Design Token Systems] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "triggerPhrase": "Write documentation for \"Design Token Systems\". Cover: what it is, when to use it, the Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file. pitfall, and how to verify with style-dictionary build + Storybook token viewer + token value comparison. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Design Token Systems. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (token JSON / CSS custom properties / theme switcher / token documentation), the common failure pattern (Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.), the best practice (Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.), and the verification command (style-dictionary build + Storybook token viewer + token value comparison).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document token JSON / CSS custom properties / theme switcher / token documentation\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Design Token Systems architecture\" — produce an ADR covering Define all visual primitives as CSS custom properties or JSON tokens."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:design-token-system",
          "workflow:explain",
          "docs",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-compose-networking-explain",
      "name": "Docker Compose Networking: Explain",
      "category": "Docs",
      "description": "[Docker Compose Networking] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "triggerPhrase": "Write documentation for \"Docker Compose Networking\". Cover: what it is, when to use it, the Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name. pitfall, and how to verify with docker compose up --wait + docker network inspect + container logs. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Docker Compose Networking. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (docker-compose.yml / network config / healthcheck / depends_on condition), the common failure pattern (Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.), the best practice (All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.), and the verification command (docker compose up --wait + docker network inspect + container logs).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document docker-compose.yml / network config / healthcheck / depends_on condition\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Docker Compose Networking architecture\" — produce an ADR covering All services in the same docker-compose."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-compose-networking",
          "workflow:explain",
          "docs",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-multistage-explain",
      "name": "Docker Multi-Stage Builds: Explain",
      "category": "Docs",
      "description": "[Docker Multi-Stage Builds] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "triggerPhrase": "Write documentation for \"Docker Multi-Stage Builds\". Cover: what it is, when to use it, the Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure. pitfall, and how to verify with docker build + docker scout + dive layer analysis. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Docker Multi-Stage Builds. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (multi-stage Dockerfile / .dockerignore / slim base image switch), the common failure pattern (Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.), the best practice (Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.), and the verification command (docker build + docker scout + dive layer analysis).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document multi-stage Dockerfile / .dockerignore / slim base image switch\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Docker Multi-Stage Builds architecture\" — produce an ADR covering Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-multistage",
          "workflow:explain",
          "docs",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "drizzle-schema-design-explain",
      "name": "Drizzle Schema Design: Explain",
      "category": "Docs",
      "description": "[Drizzle Schema Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "triggerPhrase": "Write documentation for \"Drizzle Schema Design\". Cover: what it is, when to use it, the Over-using relations() when simple foreign key columns with manual joins would be clearer and faster. pitfall, and how to verify with drizzle-kit push + drizzle-kit studio + generated SQL audit. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Drizzle Schema Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (schema.ts / relation map / migration SQL / Drizzle query builder), the common failure pattern (Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.), the best practice (Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.), and the verification command (drizzle-kit push + drizzle-kit studio + generated SQL audit).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document schema.ts / relation map / migration SQL / Drizzle query builder\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Drizzle Schema Design architecture\" — produce an ADR covering Define relations only for eagerly loaded nested data."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:explain",
          "docs",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "error-monitoring-setup-explain",
      "name": "Error Monitoring & Alerting Setup: Explain",
      "category": "Docs",
      "description": "[Error Monitoring & Alerting Setup] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "triggerPhrase": "Write documentation for \"Error Monitoring & Alerting Setup\". Cover: what it is, when to use it, the Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains. pitfall, and how to verify with Sentry API error list + alert rule test + source map validation. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Error Monitoring & Alerting Setup. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (Sentry project config / alert rule / error grouping / source map upload / performance monitoring), the common failure pattern (Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.), the best practice (Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).), and the verification command (Sentry API error list + alert rule test + source map validation).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document Sentry project config / alert rule / error grouping / source map upload / performance monitoring\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Error Monitoring & Alerting Setup architecture\" — produce an ADR covering Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:explain",
          "docs",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "fastapi-dependencies-explain",
      "name": "FastAPI Dependency Injection: Explain",
      "category": "Docs",
      "description": "[FastAPI Dependency Injection] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "triggerPhrase": "Write documentation for \"FastAPI Dependency Injection\". Cover: what it is, when to use it, the Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection. pitfall, and how to verify with uvicorn --reload + /docs interactive test + dependency graph visualisation. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting FastAPI Dependency Injection. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (dependency / lifespan handler / override for testing), the common failure pattern (Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.), the best practice (Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().), and the verification command (uvicorn --reload + /docs interactive test + dependency graph visualisation).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific dependency / lifespan handler / override for testing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document dependency / lifespan handler / override for testing\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain FastAPI Dependency Injection architecture\" — produce an ADR covering Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:explain",
          "docs",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "feature-flags-explain",
      "name": "Feature Flags & Gradual Rollouts: Explain",
      "category": "Docs",
      "description": "[Feature Flags & Gradual Rollouts] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "triggerPhrase": "Write documentation for \"Feature Flags & Gradual Rollouts\". Cover: what it is, when to use it, the Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags. pitfall, and how to verify with flag evaluation log + rollout percentage monitoring + unused flag scan. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Feature Flags & Gradual Rollouts. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (flag provider config / gradual rollout target / flag cleanup plan / A/B test flag), the common failure pattern (Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.), the best practice (Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.), and the verification command (flag evaluation log + rollout percentage monitoring + unused flag scan).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document flag provider config / gradual rollout target / flag cleanup plan / A/B test flag\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Feature Flags & Gradual Rollouts architecture\" — produce an ADR covering Treat feature flags as temporary."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:feature-flags",
          "workflow:explain",
          "docs",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "git-conflict-resolution-explain",
      "name": "Git Conflict Resolution: Explain",
      "category": "Docs",
      "description": "[Git Conflict Resolution] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "triggerPhrase": "Write documentation for \"Git Conflict Resolution\". Cover: what it is, when to use it, the Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs. pitfall, and how to verify with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Git Conflict Resolution. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message), the common failure pattern (Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.), the best practice (For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.), and the verification command (git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Git Conflict Resolution architecture\" — produce an ADR covering For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:explain",
          "docs",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "github-actions-pipeline-explain",
      "name": "GitHub Actions Pipeline Optimisation: Explain",
      "category": "Docs",
      "description": "[GitHub Actions Pipeline Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "triggerPhrase": "Write documentation for \"GitHub Actions Pipeline Optimisation\". Cover: what it is, when to use it, the Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope. pitfall, and how to verify with act --job test + cache hit/miss analysis + workflow graph visualisation. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting GitHub Actions Pipeline Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (workflow YAML / cache config / matrix build / conditional job execution), the common failure pattern (Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.), the best practice (Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.), and the verification command (act --job test + cache hit/miss analysis + workflow graph visualisation).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document workflow YAML / cache config / matrix build / conditional job execution\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain GitHub Actions Pipeline Optimisation architecture\" — produce an ADR covering Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:explain",
          "docs",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "graphql-n-plus-one-explain",
      "name": "GraphQL N+1 Query Prevention: Explain",
      "category": "Docs",
      "description": "[GraphQL N+1 Query Prevention] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "triggerPhrase": "Write documentation for \"GraphQL N+1 Query Prevention\". Cover: what it is, when to use it, the A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children. pitfall, and how to verify with graphql query with tracing + DataLoader statistics + SQL log analysis. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting GraphQL N+1 Query Prevention. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (DataLoader instance / batch load function / resolver refactor / query complexity analysis), the common failure pattern (A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.), the best practice (Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.), and the verification command (graphql query with tracing + DataLoader statistics + SQL log analysis).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document DataLoader instance / batch load function / resolver refactor / query complexity analysis\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain GraphQL N+1 Query Prevention architecture\" — produce an ADR covering Use DataLoader to batch and cache child-loading queries."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:explain",
          "docs",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "jest-test-optimization-explain",
      "name": "Jest Test Optimisation: Explain",
      "category": "Docs",
      "description": "[Jest Test Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "triggerPhrase": "Write documentation for \"Jest Test Optimisation\". Cover: what it is, when to use it, the Running the entire test suite on every change, taking minutes even for small incremental code changes. pitfall, and how to verify with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Jest Test Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking), the common failure pattern (Running the entire test suite on every change, taking minutes even for small incremental code changes.), the best practice (Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.), and the verification command (jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Jest Test Optimisation architecture\" — produce an ADR covering Use jest --changedSince to run only tests related to changed files."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:jest-test-optimization",
          "workflow:explain",
          "docs",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "json-schema-validation-explain",
      "name": "JSON Schema Validation: Explain",
      "category": "Docs",
      "description": "[JSON Schema Validation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "triggerPhrase": "Write documentation for \"JSON Schema Validation\". Cover: what it is, when to use it, the Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly. pitfall, and how to verify with ajv validate + JSON Schema test suite + response mock test. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting JSON Schema Validation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (JSON Schema / validator middleware / type guard / error message / response parser), the common failure pattern (Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.), the best practice (Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.), and the verification command (ajv validate + JSON Schema test suite + response mock test).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document JSON Schema / validator middleware / type guard / error message / response parser\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain JSON Schema Validation architecture\" — produce an ADR covering Always validate external JSON responses against a JSON Schema before accessing properties."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:json-schema-validation",
          "workflow:explain",
          "docs",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-hpa-explain",
      "name": "Kubernetes Horizontal Pod Autoscaling: Explain",
      "category": "Docs",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "triggerPhrase": "Write documentation for \"Kubernetes Horizontal Pod Autoscaling\". Cover: what it is, when to use it, the HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment. pitfall, and how to verify with kubectl get hpa --watch + kubectl top pods + metrics-server logs. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Kubernetes Horizontal Pod Autoscaling. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config), the common failure pattern (HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.), the best practice (Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.), and the verification command (kubectl get hpa --watch + kubectl top pods + metrics-server logs).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Kubernetes Horizontal Pod Autoscaling architecture\" — produce an ADR covering Always set CPU/memory requests on every container."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:explain",
          "docs",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-pod-lifecycle-explain",
      "name": "Kubernetes Pod Lifecycle: Explain",
      "category": "Docs",
      "description": "[Kubernetes Pod Lifecycle] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "triggerPhrase": "Write documentation for \"Kubernetes Pod Lifecycle\". Cover: what it is, when to use it, the Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready. pitfall, and how to verify with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Kubernetes Pod Lifecycle. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (deployment.yaml / startup probe / readiness probe / liveness probe / init container), the common failure pattern (Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.), the best practice (Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.), and the verification command (kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp').",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document deployment.yaml / startup probe / readiness probe / liveness probe / init container\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Kubernetes Pod Lifecycle architecture\" — produce an ADR covering Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:explain",
          "docs",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "mcp-tool-design-explain",
      "name": "MCP Tool Design & Best Practices: Explain",
      "category": "Docs",
      "description": "[MCP Tool Design & Best Practices] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "triggerPhrase": "Write documentation for \"MCP Tool Design & Best Practices\". Cover: what it is, when to use it, the Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent. pitfall, and how to verify with mcp-cli run + mcp inspector + tool name conflict analysis. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting MCP Tool Design & Best Practices. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (MCP tool descriptor / resource definition / prompt template / server metadata), the common failure pattern (Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.), the best practice (Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.), and the verification command (mcp-cli run + mcp inspector + tool name conflict analysis).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document MCP tool descriptor / resource definition / prompt template / server metadata\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain MCP Tool Design & Best Practices architecture\" — produce an ADR covering Prefix tool names with a namespace that reflects their domain (e."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:mcp-tool-design",
          "workflow:explain",
          "docs",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "message-queues-explain",
      "name": "Message Queues & Background Jobs: Explain",
      "category": "Docs",
      "description": "[Message Queues & Background Jobs] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "triggerPhrase": "Write documentation for \"Message Queues & Background Jobs\". Cover: what it is, when to use it, the Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled. pitfall, and how to verify with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Message Queues & Background Jobs. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (queue producer / worker / dead-letter handler / retry policy), the common failure pattern (Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.), the best practice (Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.), and the verification command (Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document queue producer / worker / dead-letter handler / retry policy\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Message Queues & Background Jobs architecture\" — produce an ADR covering Disable auto-ack."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:message-queues",
          "workflow:explain",
          "docs",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "multi-tenant-isolation-explain",
      "name": "Multi-Tenant Data Isolation: Explain",
      "category": "Docs",
      "description": "[Multi-Tenant Data Isolation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "triggerPhrase": "Write documentation for \"Multi-Tenant Data Isolation\". Cover: what it is, when to use it, the Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data. pitfall, and how to verify with RLS policy test with two different tenant sessions + data leakage check. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Multi-Tenant Data Isolation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (RLS policy / tenant context middleware / session variable injection / tenant-aware query builder), the common failure pattern (Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.), the best practice (Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.), and the verification command (RLS policy test with two different tenant sessions + data leakage check).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document RLS policy / tenant context middleware / session variable injection / tenant-aware query builder\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Multi-Tenant Data Isolation architecture\" — produce an ADR covering Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:explain",
          "docs",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-api-routes-explain",
      "name": "Next.js API Routes & Route Handlers: Explain",
      "category": "Docs",
      "description": "[Next.js API Routes & Route Handlers] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "triggerPhrase": "Write documentation for \"Next.js API Routes & Route Handlers\". Cover: what it is, when to use it, the Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component. pitfall, and how to verify with curl --verbose + API route error log + status code audit. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Next.js API Routes & Route Handlers. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (route.ts handler / server action / API client wrapper / error boundary), the common failure pattern (Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.), the best practice (All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.), and the verification command (curl --verbose + API route error log + status code audit).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document route.ts handler / server action / API client wrapper / error boundary\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Next.js API Routes & Route Handlers architecture\" — produce an ADR covering All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:explain",
          "docs",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-data-fetching-explain",
      "name": "Next.js Data Fetching Patterns: Explain",
      "category": "Docs",
      "description": "[Next.js Data Fetching Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "triggerPhrase": "Write documentation for \"Next.js Data Fetching Patterns\". Cover: what it is, when to use it, the Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests. pitfall, and how to verify with next build --debug + React DevTools fetch profiling. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Next.js Data Fetching Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (server fetch / React cache wrapper / streaming suspense boundary), the common failure pattern (Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.), the best practice (Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.), and the verification command (next build --debug + React DevTools fetch profiling).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document server fetch / React cache wrapper / streaming suspense boundary\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Next.js Data Fetching Patterns architecture\" — produce an ADR covering Use server components for initial data fetch and pass down as props."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:explain",
          "docs",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-middleware-explain",
      "name": "Next.js Middleware & Edge Runtime: Explain",
      "category": "Docs",
      "description": "[Next.js Middleware & Edge Runtime] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "triggerPhrase": "Write documentation for \"Next.js Middleware & Edge Runtime\". Cover: what it is, when to use it, the Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes. pitfall, and how to verify with next dev + curl --cookie tests + edge runtime log inspection. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Next.js Middleware & Edge Runtime. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (middleware.ts / rewrite rule / cookie-based redirect / geolocation routing), the common failure pattern (Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.), the best practice (Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.), and the verification command (next dev + curl --cookie tests + edge runtime log inspection).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document middleware.ts / rewrite rule / cookie-based redirect / geolocation routing\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Next.js Middleware & Edge Runtime architecture\" — produce an ADR covering Keep middleware stateless and light."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-middleware",
          "workflow:explain",
          "docs",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-error-handling-explain",
      "name": "Node.js Error Handling & Resilience: Explain",
      "category": "Docs",
      "description": "[Node.js Error Handling & Resilience] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "triggerPhrase": "Write documentation for \"Node.js Error Handling & Resilience\". Cover: what it is, when to use it, the Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context. pitfall, and how to verify with node --unhandled-rejections=strict + process.on('uncaughtException') log. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Node.js Error Handling & Resilience. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (global error handler / async wrapper / structured error response / retry logic), the common failure pattern (Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.), the best practice (Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.), and the verification command (node --unhandled-rejections=strict + process.on('uncaughtException') log).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document global error handler / async wrapper / structured error response / retry logic\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Node.js Error Handling & Resilience architecture\" — produce an ADR covering Use a global error handler for uncaught exceptions and unhandled rejections."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-error-handling",
          "workflow:explain",
          "docs",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-streams-explain",
      "name": "Node.js Streams & Backpressure: Explain",
      "category": "Docs",
      "description": "[Node.js Streams & Backpressure] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "triggerPhrase": "Write documentation for \"Node.js Streams & Backpressure\". Cover: what it is, when to use it, the Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams. pitfall, and how to verify with Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Node.js Streams & Backpressure. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (Readable/Writable stream / Transform / pipeline() refactor), the common failure pattern (Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.), the best practice (Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.), and the verification command (Node.js --inspect memory heap snapshot + stream highWaterMark tuning).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document Readable/Writable stream / Transform / pipeline() refactor\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Node.js Streams & Backpressure architecture\" — produce an ADR covering Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-streams",
          "workflow:explain",
          "docs",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "oauth-flows-explain",
      "name": "OAuth 2.0 Flows & Token Management: Explain",
      "category": "Docs",
      "description": "[OAuth 2.0 Flows & Token Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "triggerPhrase": "Write documentation for \"OAuth 2.0 Flows & Token Management\". Cover: what it is, when to use it, the Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation. pitfall, and how to verify with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting OAuth 2.0 Flows & Token Management. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (OAuth callback / token refresh / PKCE flow / httpOnly cookie handler), the common failure pattern (Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.), the best practice (Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.), and the verification command (oauth2_proxy + jwt.io debugger + curl --cookie with token inspection).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document OAuth callback / token refresh / PKCE flow / httpOnly cookie handler\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain OAuth 2.0 Flows & Token Management architecture\" — produce an ADR covering Store tokens in an httpOnly cookie set by the server, not in client-side storage."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:oauth-flows",
          "workflow:explain",
          "docs",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "openapi-spec-explain",
      "name": "OpenAPI Specification & Validation: Explain",
      "category": "Docs",
      "description": "[OpenAPI Specification & Validation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "triggerPhrase": "Write documentation for \"OpenAPI Specification & Validation\". Cover: what it is, when to use it, the Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code. pitfall, and how to verify with redocly lint + openapi-diff + swagger-ui preview. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting OpenAPI Specification & Validation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (openapi.yaml / code-first generator / request/response validation middleware), the common failure pattern (Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.), the best practice (Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.), and the verification command (redocly lint + openapi-diff + swagger-ui preview).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document openapi.yaml / code-first generator / request/response validation middleware\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain OpenAPI Specification & Validation architecture\" — produce an ADR covering Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:openapi-spec",
          "workflow:explain",
          "docs",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "playwright-selectors-explain",
      "name": "Playwright Selectors & Locators: Explain",
      "category": "Docs",
      "description": "[Playwright Selectors & Locators] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "triggerPhrase": "Write documentation for \"Playwright Selectors & Locators\". Cover: what it is, when to use it, the Using fragile CSS selectors (nth-child, class names that change) that break on every UI update. pitfall, and how to verify with playwright test --reporter=html + playwright codegen + trace viewer. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Playwright Selectors & Locators. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (locator refactor / test fixture / POM (Page Object Model) / custom fixture), the common failure pattern (Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.), the best practice (Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.), and the verification command (playwright test --reporter=html + playwright codegen + trace viewer).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document locator refactor / test fixture / POM (Page Object Model) / custom fixture\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Playwright Selectors & Locators architecture\" — produce an ADR covering Use getByRole, getByText, or getByTestId with semantic naming."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:playwright-selectors",
          "workflow:explain",
          "docs",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "prompt-injection-defense-explain",
      "name": "Prompt Injection Defense: Explain",
      "category": "Docs",
      "description": "[Prompt Injection Defense] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "triggerPhrase": "Write documentation for \"Prompt Injection Defense\". Cover: what it is, when to use it, the Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'. pitfall, and how to verify with prompt injection test suite + adversarial input fuzzing + output scanner. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Prompt Injection Defense. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (defensive system prompt / input sanitizer / instruction guardrail / output validator), the common failure pattern (Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.), the best practice (Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.), and the verification command (prompt injection test suite + adversarial input fuzzing + output scanner).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document defensive system prompt / input sanitizer / instruction guardrail / output validator\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Prompt Injection Defense architecture\" — produce an ADR covering Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:explain",
          "docs",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-async-explain",
      "name": "Python Async/Await Patterns: Explain",
      "category": "Docs",
      "description": "[Python Async/Await Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "triggerPhrase": "Write documentation for \"Python Async/Await Patterns\". Cover: what it is, when to use it, the Blocking the event loop by using synchronous requests or time.sleep inside async functions. pitfall, and how to verify with python3 -m asyncio + aiohttp/httpx async benchmark. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Python Async/Await Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (async/await refactor / asyncio.gather / async context manager), the common failure pattern (Blocking the event loop by using synchronous requests or time.sleep inside async functions.), the best practice (Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.), and the verification command (python3 -m asyncio + aiohttp/httpx async benchmark).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document async/await refactor / asyncio.gather / async context manager\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Python Async/Await Patterns architecture\" — produce an ADR covering Use httpx."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-async",
          "workflow:explain",
          "docs",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-file-io-explain",
      "name": "Python File I/O & Encoding: Explain",
      "category": "Docs",
      "description": "[Python File I/O & Encoding] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "triggerPhrase": "Write documentation for \"Python File I/O & Encoding\". Cover: what it is, when to use it, the Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content. pitfall, and how to verify with python3 -c with open() + chardet encoding detection. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Python File I/O & Encoding. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (pathlib refactor / encoding-safe file reader / batch file processor), the common failure pattern (Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.), the best practice (Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.), and the verification command (python3 -c with open() + chardet encoding detection).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document pathlib refactor / encoding-safe file reader / batch file processor\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Python File I/O & Encoding architecture\" — produce an ADR covering Always specify encoding explicitly when opening text files."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-file-io",
          "workflow:explain",
          "docs",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rag-chunking-explain",
      "name": "RAG Chunking Strategies: Explain",
      "category": "Docs",
      "description": "[RAG Chunking Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "triggerPhrase": "Write documentation for \"RAG Chunking Strategies\". Cover: what it is, when to use it, the Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality. pitfall, and how to verify with retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting RAG Chunking Strategies. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment), the common failure pattern (Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.), the best practice (Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.), and the verification command (retrieval evaluation script + chunk boundary visualisation + recall@k measurement).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain RAG Chunking Strategies architecture\" — produce an ADR covering Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rag-chunking",
          "workflow:explain",
          "docs",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rate-limiting-proxy-explain",
      "name": "Rate Limiting & API Gateway Proxy: Explain",
      "category": "Docs",
      "description": "[Rate Limiting & API Gateway Proxy] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "triggerPhrase": "Write documentation for \"Rate Limiting & API Gateway Proxy\". Cover: what it is, when to use it, the Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources. pitfall, and how to verify with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Rate Limiting & API Gateway Proxy. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation), the common failure pattern (Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.), the best practice (Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.), and the verification command (ab -n 1000 -c 10 + nginx error log + 429 response code monitoring).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Rate Limiting & API Gateway Proxy architecture\" — produce an ADR covering Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:explain",
          "docs",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-server-components-explain",
      "name": "React Server Components: Explain",
      "category": "Docs",
      "description": "[React Server Components] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "triggerPhrase": "Write documentation for \"React Server Components\". Cover: what it is, when to use it, the Accidentally making a server component a client component by using hooks or event handlers in the wrong file. pitfall, and how to verify with next build --debug + React Server Components lint rule. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting React Server Components. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (server component / client boundary refactor / streaming fallback), the common failure pattern (Accidentally making a server component a client component by using hooks or event handlers in the wrong file.), the best practice (Keep data fetching and heavy logic in server components; pass results as props to client islands.), and the verification command (next build --debug + React Server Components lint rule).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document server component / client boundary refactor / streaming fallback\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain React Server Components architecture\" — produce an ADR covering Keep data fetching and heavy logic in server components; pass results as props to client islands."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-server-components",
          "workflow:explain",
          "docs",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-state-explain",
      "name": "React State Management: Explain",
      "category": "Docs",
      "description": "[React State Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "triggerPhrase": "Write documentation for \"React State Management\". Cover: what it is, when to use it, the Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation. pitfall, and how to verify with React DevTools profiler + why-did-you-render. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting React State Management. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (useState / useReducer / useContext hook refactor, zustand or jotai store slice), the common failure pattern (Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.), the best practice (Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.), and the verification command (React DevTools profiler + why-did-you-render).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document useState / useReducer / useContext hook refactor, zustand or jotai store slice\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain React State Management architecture\" — produce an ADR covering Co-locate state as close to the consuming component as possible."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-state",
          "workflow:explain",
          "docs",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "redis-caching-explain",
      "name": "Redis Caching Strategies: Explain",
      "category": "Docs",
      "description": "[Redis Caching Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "triggerPhrase": "Write documentation for \"Redis Caching Strategies\". Cover: what it is, when to use it, the Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time. pitfall, and how to verify with redis-cli --stat + cache hit ratio monitoring + slow log. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Redis Caching Strategies. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (cache wrapper / mutex lock / stale-while-revalidate / TTL policy), the common failure pattern (Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.), the best practice (Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.), and the verification command (redis-cli --stat + cache hit ratio monitoring + slow log).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document cache wrapper / mutex lock / stale-while-revalidate / TTL policy\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Redis Caching Strategies architecture\" — produce an ADR covering Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:redis-caching",
          "workflow:explain",
          "docs",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rest-pagination-explain",
      "name": "REST Pagination Design: Explain",
      "category": "Docs",
      "description": "[REST Pagination Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "triggerPhrase": "Write documentation for \"REST Pagination Design\". Cover: what it is, when to use it, the Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows. pitfall, and how to verify with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting REST Pagination Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (cursor pagination / offset pagination fallback / total count optimisation / response envelope), the common failure pattern (Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.), the best practice (Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.), and the verification command (curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document cursor pagination / offset pagination fallback / total count optimisation / response envelope\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain REST Pagination Design architecture\" — produce an ADR covering Use cursor-based pagination (keyset pagination) for large datasets."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rest-pagination",
          "workflow:explain",
          "docs",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "secrets-rotation-explain",
      "name": "Secrets Rotation Policy: Explain",
      "category": "Docs",
      "description": "[Secrets Rotation Policy] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "triggerPhrase": "Write documentation for \"Secrets Rotation Policy\". Cover: what it is, when to use it, the Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak. pitfall, and how to verify with vault lease list + secret expiry check + rotation dry-run test. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Secrets Rotation Policy. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (rotation script / vault integration / lease management / incident response plan), the common failure pattern (Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.), the best practice (Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.), and the verification command (vault lease list + secret expiry check + rotation dry-run test).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document rotation script / vault integration / lease management / incident response plan\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Secrets Rotation Policy architecture\" — produce an ADR covering Automate secret rotation with a scheduled job."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:secrets-rotation",
          "workflow:explain",
          "docs",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "shell-script-robustness-explain",
      "name": "Shell Script Robustness & Safety: Explain",
      "category": "Docs",
      "description": "[Shell Script Robustness & Safety] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "triggerPhrase": "Write documentation for \"Shell Script Robustness & Safety\". Cover: what it is, when to use it, the Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage. pitfall, and how to verify with shellcheck script.sh + bash -n script.sh + dry-run mode test. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Shell Script Robustness & Safety. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function), the common failure pattern (Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.), the best practice (Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.), and the verification command (shellcheck script.sh + bash -n script.sh + dry-run mode test).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Shell Script Robustness & Safety architecture\" — produce an ADR covering Always start scripts with 'set -euo pipefail'."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:shell-script-robustness",
          "workflow:explain",
          "docs",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "sql-query-optimization-explain",
      "name": "SQL Query Optimisation: Explain",
      "category": "Docs",
      "description": "[SQL Query Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "triggerPhrase": "Write documentation for \"SQL Query Optimisation\". Cover: what it is, when to use it, the Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs. pitfall, and how to verify with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting SQL Query Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (indexed query / composite index / EXPLAIN ANALYSE plan / partial index), the common failure pattern (Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.), the best practice (Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.), and the verification command (EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document indexed query / composite index / EXPLAIN ANALYSE plan / partial index\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain SQL Query Optimisation architecture\" — produce an ADR covering Always select only the columns you need."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:sql-query-optimization",
          "workflow:explain",
          "docs",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stealth-web-research-explain",
      "name": "Stealth Web Research & Harvesting: Explain",
      "category": "Docs",
      "description": "[Stealth Web Research & Harvesting] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "triggerPhrase": "Write documentation for \"Stealth Web Research & Harvesting\". Cover: what it is, when to use it, the Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests. pitfall, and how to verify with playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Stealth Web Research & Harvesting. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages), the common failure pattern (Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.), the best practice (Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.), and the verification command (playwright-extra + stealth + cheerio + defuddle + manual jq inspection).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Stealth Web Research & Harvesting architecture\" — produce an ADR covering Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin)."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stealth-web-research",
          "workflow:explain",
          "docs",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stripe-webhook-idempotency-explain",
      "name": "Stripe Webhook Idempotency: Explain",
      "category": "Docs",
      "description": "[Stripe Webhook Idempotency] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "triggerPhrase": "Write documentation for \"Stripe Webhook Idempotency\". Cover: what it is, when to use it, the Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations. pitfall, and how to verify with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Stripe Webhook Idempotency. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (Webhook handler / idempotency key check / event deduplication / failed payment recovery), the common failure pattern (Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.), the best practice (Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.), and the verification command (stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document Webhook handler / idempotency key check / event deduplication / failed payment recovery\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Stripe Webhook Idempotency architecture\" — produce an ADR covering Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:explain",
          "docs",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "supabase-rls-explain",
      "name": "Supabase Row-Level Security: Explain",
      "category": "Docs",
      "description": "[Supabase Row-Level Security] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "triggerPhrase": "Write documentation for \"Supabase Row-Level Security\". Cover: what it is, when to use it, the RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data. pitfall, and how to verify with supabase db check + supabase db test + RLS policy review with pg_policies. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Supabase Row-Level Security. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (RLS policy / policy test / security definer function / admin bypass), the common failure pattern (RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.), the best practice (Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.), and the verification command (supabase db check + supabase db test + RLS policy review with pg_policies).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document RLS policy / policy test / security definer function / admin bypass\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Supabase Row-Level Security architecture\" — produce an ADR covering Always reference auth."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:supabase-rls",
          "workflow:explain",
          "docs",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "terraform-state-explain",
      "name": "Terraform State Management: Explain",
      "category": "Docs",
      "description": "[Terraform State Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "triggerPhrase": "Write documentation for \"Terraform State Management\". Cover: what it is, when to use it, the Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure. pitfall, and how to verify with terraform plan + terraform state list + terraform state pull | jq. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Terraform State Management. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (backend config / state migration plan / state locking config / remote state datasource), the common failure pattern (Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.), the best practice (Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.), and the verification command (terraform plan + terraform state list + terraform state pull | jq).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document backend config / state migration plan / state locking config / remote state datasource\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Terraform State Management architecture\" — produce an ADR covering Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:terraform-state",
          "workflow:explain",
          "docs",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "typescript-generics-explain",
      "name": "TypeScript Generics & Advanced Types: Explain",
      "category": "Docs",
      "description": "[TypeScript Generics & Advanced Types] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "triggerPhrase": "Write documentation for \"TypeScript Generics & Advanced Types\". Cover: what it is, when to use it, the Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice). pitfall, and how to verify with tsc --noEmit --strict + type tests with expect-type. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting TypeScript Generics & Advanced Types. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (generic type / conditional type / mapped type / branded type), the common failure pattern (Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).), the best practice (Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.), and the verification command (tsc --noEmit --strict + type tests with expect-type).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document generic type / conditional type / mapped type / branded type\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain TypeScript Generics & Advanced Types architecture\" — produce an ADR covering Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:typescript-generics",
          "workflow:explain",
          "docs",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "user-onboarding-flow-explain",
      "name": "User Onboarding Flow Design: Explain",
      "category": "Docs",
      "description": "[User Onboarding Flow Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "triggerPhrase": "Write documentation for \"User Onboarding Flow Design\". Cover: what it is, when to use it, the Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value. pitfall, and how to verify with analytics funnel analysis + onboarding completion rate + drop-off heatmap. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting User Onboarding Flow Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (onboarding wizard / feature checklist / in-app guide / first-run experience spec), the common failure pattern (Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.), the best practice (Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.), and the verification command (analytics funnel analysis + onboarding completion rate + drop-off heatmap).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document onboarding wizard / feature checklist / in-app guide / first-run experience spec\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain User Onboarding Flow Design architecture\" — produce an ADR covering Use progressive disclosure: only introduce features when the user reaches the point where they need them."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:explain",
          "docs",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "vercel-env-vars-explain",
      "name": "Vercel Environment Variables: Explain",
      "category": "Docs",
      "description": "[Vercel Environment Variables] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "triggerPhrase": "Write documentation for \"Vercel Environment Variables\". Cover: what it is, when to use it, the Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments. pitfall, and how to verify with vercel env pull + vercel list + project settings audit. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Vercel Environment Variables. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (vercel.json env group / preview env config / Edge Config / KV store), the common failure pattern (Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.), the best practice (Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.), and the verification command (vercel env pull + vercel list + project settings audit).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document vercel.json env group / preview env config / Edge Config / KV store\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Vercel Environment Variables architecture\" — produce an ADR covering Use separate environment groups for production, preview, and development."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:vercel-env-vars",
          "workflow:explain",
          "docs",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-scraping-ethics-explain",
      "name": "Web Scraping Ethics & Compliance: Explain",
      "category": "Docs",
      "description": "[Web Scraping Ethics & Compliance] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "triggerPhrase": "Write documentation for \"Web Scraping Ethics & Compliance\". Cover: what it is, when to use it, the Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues. pitfall, and how to verify with curl robots.txt + wget --wait + scraper log audit. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Web Scraping Ethics & Compliance. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (robots.txt check / polite scraper / rate-limited crawler / cached scraper), the common failure pattern (Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.), the best practice (Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.), and the verification command (curl robots.txt + wget --wait + scraper log audit).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document robots.txt check / polite scraper / rate-limited crawler / cached scraper\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Web Scraping Ethics & Compliance architecture\" — produce an ADR covering Always check robots."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:explain",
          "docs",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "websocket-reconnection-explain",
      "name": "WebSocket Reconnection Strategies: Explain",
      "category": "Docs",
      "description": "[WebSocket Reconnection Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "triggerPhrase": "Write documentation for \"WebSocket Reconnection Strategies\". Cover: what it is, when to use it, the Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state. pitfall, and how to verify with Browser DevTools Network tab WS filter + reconnection test with server restart. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting WebSocket Reconnection Strategies. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (WebSocket client / reconnection logic / heartbeat / connection status component), the common failure pattern (Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.), the best practice (Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.), and the verification command (Browser DevTools Network tab WS filter + reconnection test with server restart).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document WebSocket client / reconnection logic / heartbeat / connection status component\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain WebSocket Reconnection Strategies architecture\" — produce an ADR covering Implement exponential backoff reconnection with a maximum delay of 30 seconds."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:websocket-reconnection",
          "workflow:explain",
          "docs",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-vitals-optimization-explain",
      "name": "Web Vitals Optimisation (LCP/CLS/INP): Explain",
      "category": "Docs",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "triggerPhrase": "Write documentation for \"Web Vitals Optimisation (LCP/CLS/INP)\". Cover: what it is, when to use it, the Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions). pitfall, and how to verify with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting Web Vitals Optimisation (LCP/CLS/INP). Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (image optimisation / font display swap / critical CSS / lazy load / bundle analysis), the common failure pattern (Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).), the best practice (Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.), and the verification command (Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Document image optimisation / font display swap / critical CSS / lazy load / bundle analysis\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain Web Vitals Optimisation (LCP/CLS/INP) architecture\" — produce an ADR covering Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:explain",
          "docs",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "context-window-budget-explain",
      "name": "LLM Context Window Budget Management: Explain",
      "category": "Documentation",
      "description": "[LLM Context Window Budget Management] Document the domain: purpose, output, common failure, best practice, verification command Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "triggerPhrase": "Write documentation for \"LLM Context Window Budget Management\". Cover: what it is, when to use it, the Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness. pitfall, and how to verify with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Output must be readable by both humans and AI agents.",
      "promptTemplate": "You are documenting LLM Context Window Budget Management. Document the domain: purpose, output, common failure, best practice, verification command. Cover: the purpose, the output (trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard), the common failure pattern (Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.), the best practice (Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.), and the verification command (tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry).",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        }
      ],
      "examples": [
        "\"Document trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard\" — write a runbook with setup, usage, and troubleshooting.",
        "\"Explain LLM Context Window Budget Management architecture\" — produce an ADR covering Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:context-window-budget",
          "workflow:explain",
          "documentation",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "codebase-navigator",
      "name": "Codebase Navigator",
      "category": "Engineering",
      "description": "Scans a repository to identify the files relevant to a given goal, maps dependency relationships, and produces a minimal-change plan. Reduces the risk of unintended side-effects by flagging shared modules.",
      "triggerPhrase": "Call this before writing any code in an unfamiliar repository or before modifying a system you have not fully explored.",
      "promptTemplate": "List the project's top-level directory structure. For each directory, summarise its purpose based on file names and imports. Identify the files most likely related to the user's goal. Map their import/export dependencies. Highlight potential side-effect files (shared utilities, common types, global config). Produce a minimal set of files to modify, ordered by dependency. Flag any files that are safe to edit versus those that need cautious amendment.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "json",
          "name": "fileMap",
          "required": false,
          "description": "Directory tree or search results from repository exploration."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "In a Next.js monorepo with shared ui-library, identify the specific page, layout, component, and API route that need changes for a new settings page.",
        "In a Python monorepo with multiple services, trace the import chain from a CLI entry point to the database layer."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "exploration",
          "impact-analysis",
          "repo-mapping"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "implementation-sprint",
      "name": "Implementation Sprint",
      "category": "Engineering",
      "description": "Turns a plan into small, independently verifiable code patches. Each patch includes a clear purpose, file list, expected behaviour change, and a validation command. Dependencies are resolved first; UI and polish come last.",
      "triggerPhrase": "Call this after a plan is approved and you are ready to start writing or editing code.",
      "promptTemplate": "Divide the approved plan into patches of no more than 3 files each. For each patch: state the purpose, list the files, describe the expected behavioural change, and provide a verification command (lint, type-check, unit-test, or manual curl). Order patches by dependency: foundation first (types, schema), then logic (services, hooks), then binding (API, state), then presentation (UI), then polish (styles, comments). After each patch, run its verification command before proceeding.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "Patch 1: define Prisma/Drizzle schema for 'team' table → run 'npx drizzle-kit push'. Patch 2: create CRUD API routes for teams → run 'curl each endpoint'. Patch 3: build team management UI → run 'npm run build'.",
        "Patch 1: add TypeScript types for new feature flag. Patch 2: implement feature flag service with tests. Patch 3: integrate flag into existing UI component."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "implementation",
          "patch",
          "incremental"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a-b-testing-framework-build",
      "name": "A/B Testing Framework: Build",
      "category": "Implementation",
      "description": "[A/B Testing Framework] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "triggerPhrase": "Write or modify code for \"A/B Testing Framework\". The typical output is experiment spec / variant assignment / metric definition / statistical analysis script. Keep the best practice in mind: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Verify with: statsmodels sample size calculation + Bayesian A/B test + sequential testing.",
      "promptTemplate": "You are implementing a change for A/B Testing Framework. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is experiment spec / variant assignment / metric definition / statistical analysis script. Follow the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Run statsmodels sample size calculation + Bayesian A/B test + sequential testing after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement experiment spec / variant assignment / metric definition / statistical analysis script\" — write patches in the correct dependency order, verified with statsmodels sample size calculation.",
        "\"Add A/B Testing Framework support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:build",
          "implementation",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a11y-aria-patterns-build",
      "name": "Accessibility ARIA Patterns: Build",
      "category": "Implementation",
      "description": "[Accessibility ARIA Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "triggerPhrase": "Write or modify code for \"Accessibility ARIA Patterns\". The typical output is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Keep the best practice in mind: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Verify with: axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit.",
      "promptTemplate": "You are implementing a change for Accessibility ARIA Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Follow the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Run axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement ARIA attribute refactor / keyboard navigation / focus management / screen reader test script\" — write patches in the correct dependency order, verified with axe-core.",
        "\"Add Accessibility ARIA Patterns support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:build",
          "implementation",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "agent-tool-binding-build",
      "name": "Agent Tool Binding & Dispatch: Build",
      "category": "Implementation",
      "description": "[Agent Tool Binding & Dispatch] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "triggerPhrase": "Write or modify code for \"Agent Tool Binding & Dispatch\". The typical output is router tool / domain group / dynamic tool injection / tool usage statistics. Keep the best practice in mind: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Verify with: agent trace log + tool invocation frequency analysis + token cost audit.",
      "promptTemplate": "You are implementing a change for Agent Tool Binding & Dispatch. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is router tool / domain group / dynamic tool injection / tool usage statistics. Follow the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Run agent trace log + tool invocation frequency analysis + token cost audit after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement router tool / domain group / dynamic tool injection / tool usage statistics\" — write patches in the correct dependency order, verified with agent trace log.",
        "\"Add Agent Tool Binding & Dispatch support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:agent-tool-binding",
          "workflow:build",
          "implementation",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "analytics-metric-definition-build",
      "name": "Analytics Metric Definitions: Build",
      "category": "Implementation",
      "description": "[Analytics Metric Definitions] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "triggerPhrase": "Write or modify code for \"Analytics Metric Definitions\". The typical output is metric definition / dbt model / SQL logic / dashboard tile / documentation. Keep the best practice in mind: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Verify with: dbt docs generate + dbt test --select tag:metrics + metric comparison script.",
      "promptTemplate": "You are implementing a change for Analytics Metric Definitions. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is metric definition / dbt model / SQL logic / dashboard tile / documentation. Follow the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Run dbt docs generate + dbt test --select tag:metrics + metric comparison script after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement metric definition / dbt model / SQL logic / dashboard tile / documentation\" — write patches in the correct dependency order, verified with dbt docs generate.",
        "\"Add Analytics Metric Definitions support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:build",
          "implementation",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "adr-documentation-build",
      "name": "Architecture Decision Records: Build",
      "category": "Implementation",
      "description": "[Architecture Decision Records] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "triggerPhrase": "Write or modify code for \"Architecture Decision Records\". The typical output is ADR document / decision log / template / review workflow. Keep the best practice in mind: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Verify with: adr-tools list + adr-tools generate + decision log index page.",
      "promptTemplate": "You are implementing a change for Architecture Decision Records. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is ADR document / decision log / template / review workflow. Follow the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Run adr-tools list + adr-tools generate + decision log index page after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ADR document / decision log / template / review workflow this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement ADR document / decision log / template / review workflow\" — write patches in the correct dependency order, verified with adr-tools list.",
        "\"Add Architecture Decision Records support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:adr-documentation",
          "workflow:build",
          "implementation",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "aws-lambda-cold-start-build",
      "name": "AWS Lambda Cold Starts: Build",
      "category": "Implementation",
      "description": "[AWS Lambda Cold Starts] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "triggerPhrase": "Write or modify code for \"AWS Lambda Cold Starts\". The typical output is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Keep the best practice in mind: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Verify with: AWS X-Ray trace + Lambda Insights + cold start dashboard.",
      "promptTemplate": "You are implementing a change for AWS Lambda Cold Starts. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Follow the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Run AWS X-Ray trace + Lambda Insights + cold start dashboard after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement handler refactor / SnapStart config / Provisioned Concurrency / warmer function\" — write patches in the correct dependency order, verified with AWS X-Ray trace.",
        "\"Add AWS Lambda Cold Starts support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:build",
          "implementation",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "azure-bicep-build",
      "name": "Azure Bicep Infrastructure: Build",
      "category": "Implementation",
      "description": "[Azure Bicep Infrastructure] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "triggerPhrase": "Write or modify code for \"Azure Bicep Infrastructure\". The typical output is main.bicep / module / parameter file / azd template. Keep the best practice in mind: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Verify with: az deployment group validate + az what-if + bicep build.",
      "promptTemplate": "You are implementing a change for Azure Bicep Infrastructure. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is main.bicep / module / parameter file / azd template. Follow the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Run az deployment group validate + az what-if + bicep build after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific main.bicep / module / parameter file / azd template this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement main.bicep / module / parameter file / azd template\" — write patches in the correct dependency order, verified with az deployment group validate.",
        "\"Add Azure Bicep Infrastructure support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:azure-bicep",
          "workflow:build",
          "implementation",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "browser-devtools-build",
      "name": "Browser DevTools & Debugging: Build",
      "category": "Implementation",
      "description": "[Browser DevTools & Debugging] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "triggerPhrase": "Write or modify code for \"Browser DevTools & Debugging\". The typical output is debugging workflow / breakpoint guide / performance recording / memory snapshot. Keep the best practice in mind: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Verify with: Chrome DevTools performance recording + memory heap snapshot + network throttle.",
      "promptTemplate": "You are implementing a change for Browser DevTools & Debugging. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is debugging workflow / breakpoint guide / performance recording / memory snapshot. Follow the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Run Chrome DevTools performance recording + memory heap snapshot + network throttle after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement debugging workflow / breakpoint guide / performance recording / memory snapshot\" — write patches in the correct dependency order, verified with Chrome DevTools performance recording.",
        "\"Add Browser DevTools & Debugging support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:browser-devtools",
          "workflow:build",
          "implementation",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cli-tool-design-build",
      "name": "CLI Tool Design Patterns: Build",
      "category": "Implementation",
      "description": "[CLI Tool Design Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "triggerPhrase": "Write or modify code for \"CLI Tool Design Patterns\". The typical output is CLI scaffolding / argument parser / exit code handler / --json output mode. Keep the best practice in mind: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Verify with: echo $? after CLI run + stderr redirection test + --json output validation.",
      "promptTemplate": "You are implementing a change for CLI Tool Design Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is CLI scaffolding / argument parser / exit code handler / --json output mode. Follow the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Run echo $? after CLI run + stderr redirection test + --json output validation after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement CLI scaffolding / argument parser / exit code handler / --json output mode\" — write patches in the correct dependency order, verified with echo $? after CLI run.",
        "\"Add CLI Tool Design Patterns support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cli-tool-design",
          "workflow:build",
          "implementation",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cloud-cost-optimization-build",
      "name": "Cloud Cost Optimisation: Build",
      "category": "Implementation",
      "description": "[Cloud Cost Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "triggerPhrase": "Write or modify code for \"Cloud Cost Optimisation\". The typical output is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Keep the best practice in mind: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Verify with: cloud cost explorer + instance utilisation report + auto-stop Lambda function test.",
      "promptTemplate": "You are implementing a change for Cloud Cost Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Follow the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Run cloud cost explorer + instance utilisation report + auto-stop Lambda function test after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report\" — write patches in the correct dependency order, verified with cloud cost explorer.",
        "\"Add Cloud Cost Optimisation support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:build",
          "implementation",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "code-review-checklist-build",
      "name": "Code Review Checklist: Build",
      "category": "Implementation",
      "description": "[Code Review Checklist] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "triggerPhrase": "Write or modify code for \"Code Review Checklist\". The typical output is review checklist / automated review comment / risk classification / diff summary. Keep the best practice in mind: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Verify with: git diff --stat + lint-staged + danger.js automated review + commitlint.",
      "promptTemplate": "You are implementing a change for Code Review Checklist. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is review checklist / automated review comment / risk classification / diff summary. Follow the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Run git diff --stat + lint-staged + danger.js automated review + commitlint after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement review checklist / automated review comment / risk classification / diff summary\" — write patches in the correct dependency order, verified with git diff --stat.",
        "\"Add Code Review Checklist support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:code-review-checklist",
          "workflow:build",
          "implementation",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "convex-functions-build",
      "name": "Convex Functions & Mutations: Build",
      "category": "Implementation",
      "description": "[Convex Functions & Mutations] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "triggerPhrase": "Write or modify code for \"Convex Functions & Mutations\". The typical output is mutation / query / action / component / scheduler job. Keep the best practice in mind: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Verify with: npx convex dev + dashboard OCC conflict log + custom retry logic.",
      "promptTemplate": "You are implementing a change for Convex Functions & Mutations. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is mutation / query / action / component / scheduler job. Follow the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Run npx convex dev + dashboard OCC conflict log + custom retry logic after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific mutation / query / action / component / scheduler job this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement mutation / query / action / component / scheduler job\" — write patches in the correct dependency order, verified with npx convex dev.",
        "\"Add Convex Functions & Mutations support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:convex-functions",
          "workflow:build",
          "implementation",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cron-job-reliability-build",
      "name": "Cron Job & Scheduled Task Reliability: Build",
      "category": "Implementation",
      "description": "[Cron Job & Scheduled Task Reliability] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "triggerPhrase": "Write or modify code for \"Cron Job & Scheduled Task Reliability\". The typical output is crontab entry / log rotation / idempotency guard / failure alert integration. Keep the best practice in mind: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Verify with: tail -f /var/log/cron + systemctl status cron + idempotency test script.",
      "promptTemplate": "You are implementing a change for Cron Job & Scheduled Task Reliability. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is crontab entry / log rotation / idempotency guard / failure alert integration. Follow the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Run tail -f /var/log/cron + systemctl status cron + idempotency test script after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement crontab entry / log rotation / idempotency guard / failure alert integration\" — write patches in the correct dependency order, verified with tail -f /var/log/cron.",
        "\"Add Cron Job & Scheduled Task Reliability support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cron-job-reliability",
          "workflow:build",
          "implementation",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "css-layout-build",
      "name": "CSS Layout & Responsiveness: Build",
      "category": "Implementation",
      "description": "[CSS Layout & Responsiveness] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "triggerPhrase": "Write or modify code for \"CSS Layout & Responsiveness\". The typical output is CSS layout refactor / responsive grid / container query implementation. Keep the best practice in mind: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Verify with: Lighthouse mobile emulation + browser DevTools responsive mode.",
      "promptTemplate": "You are implementing a change for CSS Layout & Responsiveness. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is CSS layout refactor / responsive grid / container query implementation. Follow the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Run Lighthouse mobile emulation + browser DevTools responsive mode after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement CSS layout refactor / responsive grid / container query implementation\" — write patches in the correct dependency order, verified with Lighthouse mobile emulation.",
        "\"Add CSS Layout & Responsiveness support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:css-layout",
          "workflow:build",
          "implementation",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "csv-data-cleaning-build",
      "name": "CSV Data Cleaning Pipeline: Build",
      "category": "Implementation",
      "description": "[CSV Data Cleaning Pipeline] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "triggerPhrase": "Write or modify code for \"CSV Data Cleaning Pipeline\". The typical output is CSV parser / row validator / column type mapper / error report / cleaned output. Keep the best practice in mind: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Verify with: python3 -c csv.DictReader + validation script + row count diff.",
      "promptTemplate": "You are implementing a change for CSV Data Cleaning Pipeline. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is CSV parser / row validator / column type mapper / error report / cleaned output. Follow the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Run python3 -c csv.DictReader + validation script + row count diff after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement CSV parser / row validator / column type mapper / error report / cleaned output\" — write patches in the correct dependency order, verified with python3 -c csv.DictReader.",
        "\"Add CSV Data Cleaning Pipeline support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:build",
          "implementation",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "database-migration-safety-build",
      "name": "Database Migration Safety: Build",
      "category": "Implementation",
      "description": "[Database Migration Safety] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "triggerPhrase": "Write or modify code for \"Database Migration Safety\". The typical output is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Keep the best practice in mind: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Verify with: pg_locks monitoring during migration + batch backfill script + rollback test.",
      "promptTemplate": "You are implementing a change for Database Migration Safety. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Follow the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Run pg_locks monitoring during migration + batch backfill script + rollback test after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement batch migration / expand-contract pattern / zero-downtime migration / rollback plan\" — write patches in the correct dependency order, verified with pg_locks monitoring during migration.",
        "\"Add Database Migration Safety support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:database-migration-safety",
          "workflow:build",
          "implementation",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "data-warehouse-schema-build",
      "name": "Data Warehouse Schema Design: Build",
      "category": "Implementation",
      "description": "[Data Warehouse Schema Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "triggerPhrase": "Write or modify code for \"Data Warehouse Schema Design\". The typical output is star schema / fact table / dimension table / ETL pipeline spec. Keep the best practice in mind: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Verify with: dbt run + dbt test + query profiling with warehouse-native tools.",
      "promptTemplate": "You are implementing a change for Data Warehouse Schema Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is star schema / fact table / dimension table / ETL pipeline spec. Follow the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Run dbt run + dbt test + query profiling with warehouse-native tools after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement star schema / fact table / dimension table / ETL pipeline spec\" — write patches in the correct dependency order, verified with dbt run.",
        "\"Add Data Warehouse Schema Design support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:build",
          "implementation",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "design-token-system-build",
      "name": "Design Token Systems: Build",
      "category": "Implementation",
      "description": "[Design Token Systems] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "triggerPhrase": "Write or modify code for \"Design Token Systems\". The typical output is token JSON / CSS custom properties / theme switcher / token documentation. Keep the best practice in mind: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Verify with: style-dictionary build + Storybook token viewer + token value comparison.",
      "promptTemplate": "You are implementing a change for Design Token Systems. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is token JSON / CSS custom properties / theme switcher / token documentation. Follow the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Run style-dictionary build + Storybook token viewer + token value comparison after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement token JSON / CSS custom properties / theme switcher / token documentation\" — write patches in the correct dependency order, verified with style-dictionary build.",
        "\"Add Design Token Systems support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:design-token-system",
          "workflow:build",
          "implementation",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-compose-networking-build",
      "name": "Docker Compose Networking: Build",
      "category": "Implementation",
      "description": "[Docker Compose Networking] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "triggerPhrase": "Write or modify code for \"Docker Compose Networking\". The typical output is docker-compose.yml / network config / healthcheck / depends_on condition. Keep the best practice in mind: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Verify with: docker compose up --wait + docker network inspect + container logs.",
      "promptTemplate": "You are implementing a change for Docker Compose Networking. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is docker-compose.yml / network config / healthcheck / depends_on condition. Follow the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Run docker compose up --wait + docker network inspect + container logs after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement docker-compose.yml / network config / healthcheck / depends_on condition\" — write patches in the correct dependency order, verified with docker compose up --wait.",
        "\"Add Docker Compose Networking support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-compose-networking",
          "workflow:build",
          "implementation",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-multistage-build",
      "name": "Docker Multi-Stage Builds: Build",
      "category": "Implementation",
      "description": "[Docker Multi-Stage Builds] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "triggerPhrase": "Write or modify code for \"Docker Multi-Stage Builds\". The typical output is multi-stage Dockerfile / .dockerignore / slim base image switch. Keep the best practice in mind: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Verify with: docker build + docker scout + dive layer analysis.",
      "promptTemplate": "You are implementing a change for Docker Multi-Stage Builds. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is multi-stage Dockerfile / .dockerignore / slim base image switch. Follow the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Run docker build + docker scout + dive layer analysis after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement multi-stage Dockerfile / .dockerignore / slim base image switch\" — write patches in the correct dependency order, verified with docker build.",
        "\"Add Docker Multi-Stage Builds support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-multistage",
          "workflow:build",
          "implementation",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "drizzle-schema-design-build",
      "name": "Drizzle Schema Design: Build",
      "category": "Implementation",
      "description": "[Drizzle Schema Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "triggerPhrase": "Write or modify code for \"Drizzle Schema Design\". The typical output is schema.ts / relation map / migration SQL / Drizzle query builder. Keep the best practice in mind: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Verify with: drizzle-kit push + drizzle-kit studio + generated SQL audit.",
      "promptTemplate": "You are implementing a change for Drizzle Schema Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is schema.ts / relation map / migration SQL / Drizzle query builder. Follow the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Run drizzle-kit push + drizzle-kit studio + generated SQL audit after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement schema.ts / relation map / migration SQL / Drizzle query builder\" — write patches in the correct dependency order, verified with drizzle-kit push.",
        "\"Add Drizzle Schema Design support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:build",
          "implementation",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "error-monitoring-setup-build",
      "name": "Error Monitoring & Alerting Setup: Build",
      "category": "Implementation",
      "description": "[Error Monitoring & Alerting Setup] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "triggerPhrase": "Write or modify code for \"Error Monitoring & Alerting Setup\". The typical output is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Keep the best practice in mind: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Verify with: Sentry API error list + alert rule test + source map validation.",
      "promptTemplate": "You are implementing a change for Error Monitoring & Alerting Setup. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Follow the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Run Sentry API error list + alert rule test + source map validation after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement Sentry project config / alert rule / error grouping / source map upload / performance monitoring\" — write patches in the correct dependency order, verified with Sentry API error list.",
        "\"Add Error Monitoring & Alerting Setup support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:build",
          "implementation",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "fastapi-dependencies-build",
      "name": "FastAPI Dependency Injection: Build",
      "category": "Implementation",
      "description": "[FastAPI Dependency Injection] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "triggerPhrase": "Write or modify code for \"FastAPI Dependency Injection\". The typical output is dependency / lifespan handler / override for testing. Keep the best practice in mind: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Verify with: uvicorn --reload + /docs interactive test + dependency graph visualisation.",
      "promptTemplate": "You are implementing a change for FastAPI Dependency Injection. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is dependency / lifespan handler / override for testing. Follow the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Run uvicorn --reload + /docs interactive test + dependency graph visualisation after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific dependency / lifespan handler / override for testing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement dependency / lifespan handler / override for testing\" — write patches in the correct dependency order, verified with uvicorn --reload.",
        "\"Add FastAPI Dependency Injection support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:build",
          "implementation",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "feature-flags-build",
      "name": "Feature Flags & Gradual Rollouts: Build",
      "category": "Implementation",
      "description": "[Feature Flags & Gradual Rollouts] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "triggerPhrase": "Write or modify code for \"Feature Flags & Gradual Rollouts\". The typical output is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Keep the best practice in mind: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Verify with: flag evaluation log + rollout percentage monitoring + unused flag scan.",
      "promptTemplate": "You are implementing a change for Feature Flags & Gradual Rollouts. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Follow the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Run flag evaluation log + rollout percentage monitoring + unused flag scan after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement flag provider config / gradual rollout target / flag cleanup plan / A/B test flag\" — write patches in the correct dependency order, verified with flag evaluation log.",
        "\"Add Feature Flags & Gradual Rollouts support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:feature-flags",
          "workflow:build",
          "implementation",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "git-conflict-resolution-build",
      "name": "Git Conflict Resolution: Build",
      "category": "Implementation",
      "description": "[Git Conflict Resolution] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "triggerPhrase": "Write or modify code for \"Git Conflict Resolution\". The typical output is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Keep the best practice in mind: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Verify with: git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere.",
      "promptTemplate": "You are implementing a change for Git Conflict Resolution. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Follow the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Run git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message\" — write patches in the correct dependency order, verified with git log --oneline -5 -- <file>.",
        "\"Add Git Conflict Resolution support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:build",
          "implementation",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "github-actions-pipeline-build",
      "name": "GitHub Actions Pipeline Optimisation: Build",
      "category": "Implementation",
      "description": "[GitHub Actions Pipeline Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "triggerPhrase": "Write or modify code for \"GitHub Actions Pipeline Optimisation\". The typical output is workflow YAML / cache config / matrix build / conditional job execution. Keep the best practice in mind: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Verify with: act --job test + cache hit/miss analysis + workflow graph visualisation.",
      "promptTemplate": "You are implementing a change for GitHub Actions Pipeline Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is workflow YAML / cache config / matrix build / conditional job execution. Follow the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Run act --job test + cache hit/miss analysis + workflow graph visualisation after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement workflow YAML / cache config / matrix build / conditional job execution\" — write patches in the correct dependency order, verified with act --job test.",
        "\"Add GitHub Actions Pipeline Optimisation support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:build",
          "implementation",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "graphql-n-plus-one-build",
      "name": "GraphQL N+1 Query Prevention: Build",
      "category": "Implementation",
      "description": "[GraphQL N+1 Query Prevention] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "triggerPhrase": "Write or modify code for \"GraphQL N+1 Query Prevention\". The typical output is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Keep the best practice in mind: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Verify with: graphql query with tracing + DataLoader statistics + SQL log analysis.",
      "promptTemplate": "You are implementing a change for GraphQL N+1 Query Prevention. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Follow the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Run graphql query with tracing + DataLoader statistics + SQL log analysis after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement DataLoader instance / batch load function / resolver refactor / query complexity analysis\" — write patches in the correct dependency order, verified with graphql query with tracing.",
        "\"Add GraphQL N+1 Query Prevention support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:build",
          "implementation",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "jest-test-optimization-build",
      "name": "Jest Test Optimisation: Build",
      "category": "Implementation",
      "description": "[Jest Test Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "triggerPhrase": "Write or modify code for \"Jest Test Optimisation\". The typical output is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Keep the best practice in mind: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Verify with: jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check.",
      "promptTemplate": "You are implementing a change for Jest Test Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Follow the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Run jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking\" — write patches in the correct dependency order, verified with jest --changedSince=main --json.",
        "\"Add Jest Test Optimisation support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:jest-test-optimization",
          "workflow:build",
          "implementation",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "json-schema-validation-build",
      "name": "JSON Schema Validation: Build",
      "category": "Implementation",
      "description": "[JSON Schema Validation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "triggerPhrase": "Write or modify code for \"JSON Schema Validation\". The typical output is JSON Schema / validator middleware / type guard / error message / response parser. Keep the best practice in mind: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Verify with: ajv validate + JSON Schema test suite + response mock test.",
      "promptTemplate": "You are implementing a change for JSON Schema Validation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is JSON Schema / validator middleware / type guard / error message / response parser. Follow the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Run ajv validate + JSON Schema test suite + response mock test after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement JSON Schema / validator middleware / type guard / error message / response parser\" — write patches in the correct dependency order, verified with ajv validate.",
        "\"Add JSON Schema Validation support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:json-schema-validation",
          "workflow:build",
          "implementation",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-hpa-build",
      "name": "Kubernetes Horizontal Pod Autoscaling: Build",
      "category": "Implementation",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "triggerPhrase": "Write or modify code for \"Kubernetes Horizontal Pod Autoscaling\". The typical output is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Keep the best practice in mind: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Verify with: kubectl get hpa --watch + kubectl top pods + metrics-server logs.",
      "promptTemplate": "You are implementing a change for Kubernetes Horizontal Pod Autoscaling. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Follow the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Run kubectl get hpa --watch + kubectl top pods + metrics-server logs after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config\" — write patches in the correct dependency order, verified with kubectl get hpa --watch.",
        "\"Add Kubernetes Horizontal Pod Autoscaling support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:build",
          "implementation",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-pod-lifecycle-build",
      "name": "Kubernetes Pod Lifecycle: Build",
      "category": "Implementation",
      "description": "[Kubernetes Pod Lifecycle] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "triggerPhrase": "Write or modify code for \"Kubernetes Pod Lifecycle\". The typical output is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Keep the best practice in mind: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Verify with: kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'.",
      "promptTemplate": "You are implementing a change for Kubernetes Pod Lifecycle. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Follow the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Run kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement deployment.yaml / startup probe / readiness probe / liveness probe / init container\" — write patches in the correct dependency order, verified with kubectl describe pod.",
        "\"Add Kubernetes Pod Lifecycle support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:build",
          "implementation",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "context-window-budget-build",
      "name": "LLM Context Window Budget Management: Build",
      "category": "Implementation",
      "description": "[LLM Context Window Budget Management] Implement the smallest viable patches in dependency order; each patch must be independently verifiable Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "triggerPhrase": "Write or modify code for \"LLM Context Window Budget Management\". The typical output is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Keep the best practice in mind: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Verify with: tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry.",
      "promptTemplate": "You are implementing a change for LLM Context Window Budget Management. Implement the smallest viable patches in dependency order; each patch must be independently verifiable. The target output is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Follow the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Run tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "diff",
          "name": "diff",
          "description": "DIFF output"
        },
        {
          "kind": "command",
          "name": "cmd",
          "description": "CMD output"
        }
      ],
      "examples": [
        "\"Implement trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard\" — write patches in the correct dependency order, verified with tiktoken count.",
        "\"Add LLM Context Window Budget Management support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:context-window-budget",
          "workflow:build",
          "implementation",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "mcp-tool-design-build",
      "name": "MCP Tool Design & Best Practices: Build",
      "category": "Implementation",
      "description": "[MCP Tool Design & Best Practices] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "triggerPhrase": "Write or modify code for \"MCP Tool Design & Best Practices\". The typical output is MCP tool descriptor / resource definition / prompt template / server metadata. Keep the best practice in mind: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Verify with: mcp-cli run + mcp inspector + tool name conflict analysis.",
      "promptTemplate": "You are implementing a change for MCP Tool Design & Best Practices. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is MCP tool descriptor / resource definition / prompt template / server metadata. Follow the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Run mcp-cli run + mcp inspector + tool name conflict analysis after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement MCP tool descriptor / resource definition / prompt template / server metadata\" — write patches in the correct dependency order, verified with mcp-cli run.",
        "\"Add MCP Tool Design & Best Practices support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:mcp-tool-design",
          "workflow:build",
          "implementation",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "message-queues-build",
      "name": "Message Queues & Background Jobs: Build",
      "category": "Implementation",
      "description": "[Message Queues & Background Jobs] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "triggerPhrase": "Write or modify code for \"Message Queues & Background Jobs\". The typical output is queue producer / worker / dead-letter handler / retry policy. Keep the best practice in mind: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Verify with: Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection.",
      "promptTemplate": "You are implementing a change for Message Queues & Background Jobs. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is queue producer / worker / dead-letter handler / retry policy. Follow the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Run Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement queue producer / worker / dead-letter handler / retry policy\" — write patches in the correct dependency order, verified with Bull/BullMQ dashboard.",
        "\"Add Message Queues & Background Jobs support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:message-queues",
          "workflow:build",
          "implementation",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "multi-tenant-isolation-build",
      "name": "Multi-Tenant Data Isolation: Build",
      "category": "Implementation",
      "description": "[Multi-Tenant Data Isolation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "triggerPhrase": "Write or modify code for \"Multi-Tenant Data Isolation\". The typical output is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Keep the best practice in mind: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Verify with: RLS policy test with two different tenant sessions + data leakage check.",
      "promptTemplate": "You are implementing a change for Multi-Tenant Data Isolation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Follow the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Run RLS policy test with two different tenant sessions + data leakage check after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement RLS policy / tenant context middleware / session variable injection / tenant-aware query builder\" — write patches in the correct dependency order, verified with RLS policy test with two different tenant sessions.",
        "\"Add Multi-Tenant Data Isolation support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:build",
          "implementation",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-api-routes-build",
      "name": "Next.js API Routes & Route Handlers: Build",
      "category": "Implementation",
      "description": "[Next.js API Routes & Route Handlers] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "triggerPhrase": "Write or modify code for \"Next.js API Routes & Route Handlers\". The typical output is route.ts handler / server action / API client wrapper / error boundary. Keep the best practice in mind: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Verify with: curl --verbose + API route error log + status code audit.",
      "promptTemplate": "You are implementing a change for Next.js API Routes & Route Handlers. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is route.ts handler / server action / API client wrapper / error boundary. Follow the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Run curl --verbose + API route error log + status code audit after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement route.ts handler / server action / API client wrapper / error boundary\" — write patches in the correct dependency order, verified with curl --verbose.",
        "\"Add Next.js API Routes & Route Handlers support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:build",
          "implementation",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-data-fetching-build",
      "name": "Next.js Data Fetching Patterns: Build",
      "category": "Implementation",
      "description": "[Next.js Data Fetching Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "triggerPhrase": "Write or modify code for \"Next.js Data Fetching Patterns\". The typical output is server fetch / React cache wrapper / streaming suspense boundary. Keep the best practice in mind: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Verify with: next build --debug + React DevTools fetch profiling.",
      "promptTemplate": "You are implementing a change for Next.js Data Fetching Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is server fetch / React cache wrapper / streaming suspense boundary. Follow the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Run next build --debug + React DevTools fetch profiling after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement server fetch / React cache wrapper / streaming suspense boundary\" — write patches in the correct dependency order, verified with next build --debug.",
        "\"Add Next.js Data Fetching Patterns support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:build",
          "implementation",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-middleware-build",
      "name": "Next.js Middleware & Edge Runtime: Build",
      "category": "Implementation",
      "description": "[Next.js Middleware & Edge Runtime] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "triggerPhrase": "Write or modify code for \"Next.js Middleware & Edge Runtime\". The typical output is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Keep the best practice in mind: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Verify with: next dev + curl --cookie tests + edge runtime log inspection.",
      "promptTemplate": "You are implementing a change for Next.js Middleware & Edge Runtime. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Follow the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Run next dev + curl --cookie tests + edge runtime log inspection after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement middleware.ts / rewrite rule / cookie-based redirect / geolocation routing\" — write patches in the correct dependency order, verified with next dev.",
        "\"Add Next.js Middleware & Edge Runtime support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-middleware",
          "workflow:build",
          "implementation",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-error-handling-build",
      "name": "Node.js Error Handling & Resilience: Build",
      "category": "Implementation",
      "description": "[Node.js Error Handling & Resilience] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "triggerPhrase": "Write or modify code for \"Node.js Error Handling & Resilience\". The typical output is global error handler / async wrapper / structured error response / retry logic. Keep the best practice in mind: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Verify with: node --unhandled-rejections=strict + process.on('uncaughtException') log.",
      "promptTemplate": "You are implementing a change for Node.js Error Handling & Resilience. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is global error handler / async wrapper / structured error response / retry logic. Follow the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Run node --unhandled-rejections=strict + process.on('uncaughtException') log after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement global error handler / async wrapper / structured error response / retry logic\" — write patches in the correct dependency order, verified with node --unhandled-rejections=strict.",
        "\"Add Node.js Error Handling & Resilience support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-error-handling",
          "workflow:build",
          "implementation",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-streams-build",
      "name": "Node.js Streams & Backpressure: Build",
      "category": "Implementation",
      "description": "[Node.js Streams & Backpressure] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "triggerPhrase": "Write or modify code for \"Node.js Streams & Backpressure\". The typical output is Readable/Writable stream / Transform / pipeline() refactor. Keep the best practice in mind: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Verify with: Node.js --inspect memory heap snapshot + stream highWaterMark tuning.",
      "promptTemplate": "You are implementing a change for Node.js Streams & Backpressure. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is Readable/Writable stream / Transform / pipeline() refactor. Follow the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Run Node.js --inspect memory heap snapshot + stream highWaterMark tuning after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement Readable/Writable stream / Transform / pipeline() refactor\" — write patches in the correct dependency order, verified with Node.js --inspect memory heap snapshot.",
        "\"Add Node.js Streams & Backpressure support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-streams",
          "workflow:build",
          "implementation",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "oauth-flows-build",
      "name": "OAuth 2.0 Flows & Token Management: Build",
      "category": "Implementation",
      "description": "[OAuth 2.0 Flows & Token Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "triggerPhrase": "Write or modify code for \"OAuth 2.0 Flows & Token Management\". The typical output is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Keep the best practice in mind: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Verify with: oauth2_proxy + jwt.io debugger + curl --cookie with token inspection.",
      "promptTemplate": "You are implementing a change for OAuth 2.0 Flows & Token Management. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Follow the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Run oauth2_proxy + jwt.io debugger + curl --cookie with token inspection after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement OAuth callback / token refresh / PKCE flow / httpOnly cookie handler\" — write patches in the correct dependency order, verified with oauth2_proxy.",
        "\"Add OAuth 2.0 Flows & Token Management support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:oauth-flows",
          "workflow:build",
          "implementation",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "openapi-spec-build",
      "name": "OpenAPI Specification & Validation: Build",
      "category": "Implementation",
      "description": "[OpenAPI Specification & Validation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "triggerPhrase": "Write or modify code for \"OpenAPI Specification & Validation\". The typical output is openapi.yaml / code-first generator / request/response validation middleware. Keep the best practice in mind: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Verify with: redocly lint + openapi-diff + swagger-ui preview.",
      "promptTemplate": "You are implementing a change for OpenAPI Specification & Validation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is openapi.yaml / code-first generator / request/response validation middleware. Follow the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Run redocly lint + openapi-diff + swagger-ui preview after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement openapi.yaml / code-first generator / request/response validation middleware\" — write patches in the correct dependency order, verified with redocly lint.",
        "\"Add OpenAPI Specification & Validation support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:openapi-spec",
          "workflow:build",
          "implementation",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "playwright-selectors-build",
      "name": "Playwright Selectors & Locators: Build",
      "category": "Implementation",
      "description": "[Playwright Selectors & Locators] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "triggerPhrase": "Write or modify code for \"Playwright Selectors & Locators\". The typical output is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Keep the best practice in mind: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Verify with: playwright test --reporter=html + playwright codegen + trace viewer.",
      "promptTemplate": "You are implementing a change for Playwright Selectors & Locators. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Follow the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Run playwright test --reporter=html + playwright codegen + trace viewer after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement locator refactor / test fixture / POM (Page Object Model) / custom fixture\" — write patches in the correct dependency order, verified with playwright test --reporter=html.",
        "\"Add Playwright Selectors & Locators support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:playwright-selectors",
          "workflow:build",
          "implementation",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "prompt-injection-defense-build",
      "name": "Prompt Injection Defense: Build",
      "category": "Implementation",
      "description": "[Prompt Injection Defense] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "triggerPhrase": "Write or modify code for \"Prompt Injection Defense\". The typical output is defensive system prompt / input sanitizer / instruction guardrail / output validator. Keep the best practice in mind: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Verify with: prompt injection test suite + adversarial input fuzzing + output scanner.",
      "promptTemplate": "You are implementing a change for Prompt Injection Defense. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is defensive system prompt / input sanitizer / instruction guardrail / output validator. Follow the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Run prompt injection test suite + adversarial input fuzzing + output scanner after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement defensive system prompt / input sanitizer / instruction guardrail / output validator\" — write patches in the correct dependency order, verified with prompt injection test suite.",
        "\"Add Prompt Injection Defense support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:build",
          "implementation",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-async-build",
      "name": "Python Async/Await Patterns: Build",
      "category": "Implementation",
      "description": "[Python Async/Await Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "triggerPhrase": "Write or modify code for \"Python Async/Await Patterns\". The typical output is async/await refactor / asyncio.gather / async context manager. Keep the best practice in mind: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Verify with: python3 -m asyncio + aiohttp/httpx async benchmark.",
      "promptTemplate": "You are implementing a change for Python Async/Await Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is async/await refactor / asyncio.gather / async context manager. Follow the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Run python3 -m asyncio + aiohttp/httpx async benchmark after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement async/await refactor / asyncio.gather / async context manager\" — write patches in the correct dependency order, verified with python3 -m asyncio.",
        "\"Add Python Async/Await Patterns support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-async",
          "workflow:build",
          "implementation",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-file-io-build",
      "name": "Python File I/O & Encoding: Build",
      "category": "Implementation",
      "description": "[Python File I/O & Encoding] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "triggerPhrase": "Write or modify code for \"Python File I/O & Encoding\". The typical output is pathlib refactor / encoding-safe file reader / batch file processor. Keep the best practice in mind: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Verify with: python3 -c with open() + chardet encoding detection.",
      "promptTemplate": "You are implementing a change for Python File I/O & Encoding. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is pathlib refactor / encoding-safe file reader / batch file processor. Follow the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Run python3 -c with open() + chardet encoding detection after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement pathlib refactor / encoding-safe file reader / batch file processor\" — write patches in the correct dependency order, verified with python3 -c with open().",
        "\"Add Python File I/O & Encoding support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-file-io",
          "workflow:build",
          "implementation",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rag-chunking-build",
      "name": "RAG Chunking Strategies: Build",
      "category": "Implementation",
      "description": "[RAG Chunking Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "triggerPhrase": "Write or modify code for \"RAG Chunking Strategies\". The typical output is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Keep the best practice in mind: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Verify with: retrieval evaluation script + chunk boundary visualisation + recall@k measurement.",
      "promptTemplate": "You are implementing a change for RAG Chunking Strategies. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Follow the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Run retrieval evaluation script + chunk boundary visualisation + recall@k measurement after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment\" — write patches in the correct dependency order, verified with retrieval evaluation script.",
        "\"Add RAG Chunking Strategies support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rag-chunking",
          "workflow:build",
          "implementation",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rate-limiting-proxy-build",
      "name": "Rate Limiting & API Gateway Proxy: Build",
      "category": "Implementation",
      "description": "[Rate Limiting & API Gateway Proxy] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "triggerPhrase": "Write or modify code for \"Rate Limiting & API Gateway Proxy\". The typical output is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Keep the best practice in mind: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Verify with: ab -n 1000 -c 10 + nginx error log + 429 response code monitoring.",
      "promptTemplate": "You are implementing a change for Rate Limiting & API Gateway Proxy. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Follow the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Run ab -n 1000 -c 10 + nginx error log + 429 response code monitoring after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation\" — write patches in the correct dependency order, verified with ab -n 1000 -c 10.",
        "\"Add Rate Limiting & API Gateway Proxy support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:build",
          "implementation",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-server-components-build",
      "name": "React Server Components: Build",
      "category": "Implementation",
      "description": "[React Server Components] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "triggerPhrase": "Write or modify code for \"React Server Components\". The typical output is server component / client boundary refactor / streaming fallback. Keep the best practice in mind: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Verify with: next build --debug + React Server Components lint rule.",
      "promptTemplate": "You are implementing a change for React Server Components. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is server component / client boundary refactor / streaming fallback. Follow the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Run next build --debug + React Server Components lint rule after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement server component / client boundary refactor / streaming fallback\" — write patches in the correct dependency order, verified with next build --debug.",
        "\"Add React Server Components support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-server-components",
          "workflow:build",
          "implementation",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-state-build",
      "name": "React State Management: Build",
      "category": "Implementation",
      "description": "[React State Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "triggerPhrase": "Write or modify code for \"React State Management\". The typical output is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Keep the best practice in mind: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Verify with: React DevTools profiler + why-did-you-render.",
      "promptTemplate": "You are implementing a change for React State Management. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Follow the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Run React DevTools profiler + why-did-you-render after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement useState / useReducer / useContext hook refactor, zustand or jotai store slice\" — write patches in the correct dependency order, verified with React DevTools profiler.",
        "\"Add React State Management support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-state",
          "workflow:build",
          "implementation",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "redis-caching-build",
      "name": "Redis Caching Strategies: Build",
      "category": "Implementation",
      "description": "[Redis Caching Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "triggerPhrase": "Write or modify code for \"Redis Caching Strategies\". The typical output is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Keep the best practice in mind: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Verify with: redis-cli --stat + cache hit ratio monitoring + slow log.",
      "promptTemplate": "You are implementing a change for Redis Caching Strategies. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Follow the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Run redis-cli --stat + cache hit ratio monitoring + slow log after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement cache wrapper / mutex lock / stale-while-revalidate / TTL policy\" — write patches in the correct dependency order, verified with redis-cli --stat.",
        "\"Add Redis Caching Strategies support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:redis-caching",
          "workflow:build",
          "implementation",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rest-pagination-build",
      "name": "REST Pagination Design: Build",
      "category": "Implementation",
      "description": "[REST Pagination Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "triggerPhrase": "Write or modify code for \"REST Pagination Design\". The typical output is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Keep the best practice in mind: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Verify with: curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark.",
      "promptTemplate": "You are implementing a change for REST Pagination Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Follow the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Run curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement cursor pagination / offset pagination fallback / total count optimisation / response envelope\" — write patches in the correct dependency order, verified with curl with cursor param.",
        "\"Add REST Pagination Design support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rest-pagination",
          "workflow:build",
          "implementation",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "secrets-rotation-build",
      "name": "Secrets Rotation Policy: Build",
      "category": "Implementation",
      "description": "[Secrets Rotation Policy] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "triggerPhrase": "Write or modify code for \"Secrets Rotation Policy\". The typical output is rotation script / vault integration / lease management / incident response plan. Keep the best practice in mind: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Verify with: vault lease list + secret expiry check + rotation dry-run test.",
      "promptTemplate": "You are implementing a change for Secrets Rotation Policy. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is rotation script / vault integration / lease management / incident response plan. Follow the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Run vault lease list + secret expiry check + rotation dry-run test after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement rotation script / vault integration / lease management / incident response plan\" — write patches in the correct dependency order, verified with vault lease list.",
        "\"Add Secrets Rotation Policy support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:secrets-rotation",
          "workflow:build",
          "implementation",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "shell-script-robustness-build",
      "name": "Shell Script Robustness & Safety: Build",
      "category": "Implementation",
      "description": "[Shell Script Robustness & Safety] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "triggerPhrase": "Write or modify code for \"Shell Script Robustness & Safety\". The typical output is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Keep the best practice in mind: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Verify with: shellcheck script.sh + bash -n script.sh + dry-run mode test.",
      "promptTemplate": "You are implementing a change for Shell Script Robustness & Safety. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Follow the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Run shellcheck script.sh + bash -n script.sh + dry-run mode test after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function\" — write patches in the correct dependency order, verified with shellcheck script.sh.",
        "\"Add Shell Script Robustness & Safety support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:shell-script-robustness",
          "workflow:build",
          "implementation",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "sql-query-optimization-build",
      "name": "SQL Query Optimisation: Build",
      "category": "Implementation",
      "description": "[SQL Query Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "triggerPhrase": "Write or modify code for \"SQL Query Optimisation\". The typical output is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Keep the best practice in mind: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Verify with: EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query.",
      "promptTemplate": "You are implementing a change for SQL Query Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Follow the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Run EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement indexed query / composite index / EXPLAIN ANALYSE plan / partial index\" — write patches in the correct dependency order, verified with EXPLAIN (ANALYSE, BUFFERS).",
        "\"Add SQL Query Optimisation support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:sql-query-optimization",
          "workflow:build",
          "implementation",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stealth-web-research-build",
      "name": "Stealth Web Research & Harvesting: Build",
      "category": "Implementation",
      "description": "[Stealth Web Research & Harvesting] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "triggerPhrase": "Write or modify code for \"Stealth Web Research & Harvesting\". The typical output is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Keep the best practice in mind: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Verify with: playwright-extra + stealth + cheerio + defuddle + manual jq inspection.",
      "promptTemplate": "You are implementing a change for Stealth Web Research & Harvesting. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Follow the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Run playwright-extra + stealth + cheerio + defuddle + manual jq inspection after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages\" — write patches in the correct dependency order, verified with playwright-extra.",
        "\"Add Stealth Web Research & Harvesting support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stealth-web-research",
          "workflow:build",
          "implementation",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stripe-webhook-idempotency-build",
      "name": "Stripe Webhook Idempotency: Build",
      "category": "Implementation",
      "description": "[Stripe Webhook Idempotency] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "triggerPhrase": "Write or modify code for \"Stripe Webhook Idempotency\". The typical output is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Keep the best practice in mind: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Verify with: stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check.",
      "promptTemplate": "You are implementing a change for Stripe Webhook Idempotency. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Follow the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Run stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement Webhook handler / idempotency key check / event deduplication / failed payment recovery\" — write patches in the correct dependency order, verified with stripe trigger payment_intent.succeeded.",
        "\"Add Stripe Webhook Idempotency support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:build",
          "implementation",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "supabase-rls-build",
      "name": "Supabase Row-Level Security: Build",
      "category": "Implementation",
      "description": "[Supabase Row-Level Security] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "triggerPhrase": "Write or modify code for \"Supabase Row-Level Security\". The typical output is RLS policy / policy test / security definer function / admin bypass. Keep the best practice in mind: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Verify with: supabase db check + supabase db test + RLS policy review with pg_policies.",
      "promptTemplate": "You are implementing a change for Supabase Row-Level Security. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is RLS policy / policy test / security definer function / admin bypass. Follow the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Run supabase db check + supabase db test + RLS policy review with pg_policies after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement RLS policy / policy test / security definer function / admin bypass\" — write patches in the correct dependency order, verified with supabase db check.",
        "\"Add Supabase Row-Level Security support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:supabase-rls",
          "workflow:build",
          "implementation",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "terraform-state-build",
      "name": "Terraform State Management: Build",
      "category": "Implementation",
      "description": "[Terraform State Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "triggerPhrase": "Write or modify code for \"Terraform State Management\". The typical output is backend config / state migration plan / state locking config / remote state datasource. Keep the best practice in mind: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Verify with: terraform plan + terraform state list + terraform state pull | jq.",
      "promptTemplate": "You are implementing a change for Terraform State Management. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is backend config / state migration plan / state locking config / remote state datasource. Follow the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Run terraform plan + terraform state list + terraform state pull | jq after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement backend config / state migration plan / state locking config / remote state datasource\" — write patches in the correct dependency order, verified with terraform plan.",
        "\"Add Terraform State Management support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:terraform-state",
          "workflow:build",
          "implementation",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "typescript-generics-build",
      "name": "TypeScript Generics & Advanced Types: Build",
      "category": "Implementation",
      "description": "[TypeScript Generics & Advanced Types] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "triggerPhrase": "Write or modify code for \"TypeScript Generics & Advanced Types\". The typical output is generic type / conditional type / mapped type / branded type. Keep the best practice in mind: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Verify with: tsc --noEmit --strict + type tests with expect-type.",
      "promptTemplate": "You are implementing a change for TypeScript Generics & Advanced Types. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is generic type / conditional type / mapped type / branded type. Follow the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Run tsc --noEmit --strict + type tests with expect-type after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement generic type / conditional type / mapped type / branded type\" — write patches in the correct dependency order, verified with tsc --noEmit --strict.",
        "\"Add TypeScript Generics & Advanced Types support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:typescript-generics",
          "workflow:build",
          "implementation",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "user-onboarding-flow-build",
      "name": "User Onboarding Flow Design: Build",
      "category": "Implementation",
      "description": "[User Onboarding Flow Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "triggerPhrase": "Write or modify code for \"User Onboarding Flow Design\". The typical output is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Keep the best practice in mind: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Verify with: analytics funnel analysis + onboarding completion rate + drop-off heatmap.",
      "promptTemplate": "You are implementing a change for User Onboarding Flow Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Follow the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Run analytics funnel analysis + onboarding completion rate + drop-off heatmap after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement onboarding wizard / feature checklist / in-app guide / first-run experience spec\" — write patches in the correct dependency order, verified with analytics funnel analysis.",
        "\"Add User Onboarding Flow Design support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:build",
          "implementation",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "vercel-env-vars-build",
      "name": "Vercel Environment Variables: Build",
      "category": "Implementation",
      "description": "[Vercel Environment Variables] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "triggerPhrase": "Write or modify code for \"Vercel Environment Variables\". The typical output is vercel.json env group / preview env config / Edge Config / KV store. Keep the best practice in mind: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Verify with: vercel env pull + vercel list + project settings audit.",
      "promptTemplate": "You are implementing a change for Vercel Environment Variables. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is vercel.json env group / preview env config / Edge Config / KV store. Follow the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Run vercel env pull + vercel list + project settings audit after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement vercel.json env group / preview env config / Edge Config / KV store\" — write patches in the correct dependency order, verified with vercel env pull.",
        "\"Add Vercel Environment Variables support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:vercel-env-vars",
          "workflow:build",
          "implementation",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-scraping-ethics-build",
      "name": "Web Scraping Ethics & Compliance: Build",
      "category": "Implementation",
      "description": "[Web Scraping Ethics & Compliance] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "triggerPhrase": "Write or modify code for \"Web Scraping Ethics & Compliance\". The typical output is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Keep the best practice in mind: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Verify with: curl robots.txt + wget --wait + scraper log audit.",
      "promptTemplate": "You are implementing a change for Web Scraping Ethics & Compliance. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Follow the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Run curl robots.txt + wget --wait + scraper log audit after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement robots.txt check / polite scraper / rate-limited crawler / cached scraper\" — write patches in the correct dependency order, verified with curl robots.txt.",
        "\"Add Web Scraping Ethics & Compliance support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:build",
          "implementation",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "websocket-reconnection-build",
      "name": "WebSocket Reconnection Strategies: Build",
      "category": "Implementation",
      "description": "[WebSocket Reconnection Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "triggerPhrase": "Write or modify code for \"WebSocket Reconnection Strategies\". The typical output is WebSocket client / reconnection logic / heartbeat / connection status component. Keep the best practice in mind: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Verify with: Browser DevTools Network tab WS filter + reconnection test with server restart.",
      "promptTemplate": "You are implementing a change for WebSocket Reconnection Strategies. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is WebSocket client / reconnection logic / heartbeat / connection status component. Follow the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Run Browser DevTools Network tab WS filter + reconnection test with server restart after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement WebSocket client / reconnection logic / heartbeat / connection status component\" — write patches in the correct dependency order, verified with Browser DevTools Network tab WS filter.",
        "\"Add WebSocket Reconnection Strategies support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:websocket-reconnection",
          "workflow:build",
          "implementation",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-vitals-optimization-build",
      "name": "Web Vitals Optimisation (LCP/CLS/INP): Build",
      "category": "Implementation",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "triggerPhrase": "Write or modify code for \"Web Vitals Optimisation (LCP/CLS/INP)\". The typical output is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Keep the best practice in mind: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Verify with: Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension.",
      "promptTemplate": "You are implementing a change for Web Vitals Optimisation (LCP/CLS/INP). Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Follow the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Run Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension after each patch.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Implement image optimisation / font display swap / critical CSS / lazy load / bundle analysis\" — write patches in the correct dependency order, verified with Lighthouse CI.",
        "\"Add Web Vitals Optimisation (LCP/CLS/INP) support\" — build incrementally, each step independently testable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:build",
          "implementation",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "adapter-smith",
      "name": "Adapter Smith",
      "category": "Integration",
      "description": "Converts any skill definition between agent runtime formats — Claude markdown, Hermes manifest, OpenAI tool descriptors, Cursor rules, LangChain registry, or MCP resources. Preserves the semantic contract across all formats.",
      "triggerPhrase": "Call this when you need to move a skill to a different agent system, or to produce a cross-platform export of the entire catalog.",
      "promptTemplate": "Identify the source skill format and the target runtime. Map each field: slug → file name, trigger → tool description, inputs → parameter schema, outputs → response contract, examples → usage hints. Preserve all risk markers and model-agnostic guarantees. If the target format lacks a field, embed it in a comment or description field. Output the complete adapter payload.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "selection",
          "name": "targetRuntime",
          "required": true,
          "description": "claude, hermes, openai, langchain, cursor, mcp or generic."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        }
      ],
      "examples": [
        "Convert all 409 skills from Claude markdown to Hermes manifest format.",
        "Export the 'intent-router' skill as an OpenAI function tool descriptor."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "adapter",
          "converter",
          "cross-platform"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "api-contract-smith",
      "name": "API Contract Smith",
      "category": "Integration",
      "description": "Designs a minimal, secure API contract for integrating an external service or internal endpoint. Specifies authentication, error contracts, rate limits, idempotency, and a proxy route for server-side secret handling.",
      "triggerPhrase": "Call this when integrating a new API, designing a service boundary, or refactoring an existing endpoint contract.",
      "promptTemplate": "Document the service purpose and authentication mechanism. List all endpoints with request and response shapes. For each endpoint: define success/error response codes, pagination (if any), rate limit headers, and idempotency key. Mandate that all secrets live in environment variables accessible only server-side. Produce a minimal Express/Next.js route that proxies the external API while stripping secrets from client payloads.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "url",
          "name": "apiDocs",
          "required": false,
          "description": "API documentation or reference link, if available."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "Design a Stripe payment proxy: /api/checkout creates a session, /api/webhook verifies signature, /api/portal generates customer portal link.",
        "Contract for a weather service: single GET endpoint, API key in Authorization header, 1000 req/day limit, 429 response on overage."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "api",
          "contract",
          "integration",
          "proxy"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a-b-testing-framework-tune",
      "name": "A/B Testing Framework: Tune",
      "category": "Optimization",
      "description": "[A/B Testing Framework] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "triggerPhrase": "Optimize \"A/B Testing Framework\". Target the failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\" or the typical verification command statsmodels sample size calculation + Bayesian A/B test + sequential testing. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising A/B Testing Framework. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is experiment spec / variant assignment / metric definition / statistical analysis script. Measure using statsmodels sample size calculation + Bayesian A/B test + sequential testing. Guard against: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise A/B Testing Framework\" — benchmark statsmodels sample size calculation before and after.",
        "\"Tune experiment spec / variant assignment / metric definition / statistical analysis script performance\" — reduce cost/latency while monitoring Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:tune",
          "optimization",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a11y-aria-patterns-tune",
      "name": "Accessibility ARIA Patterns: Tune",
      "category": "Optimization",
      "description": "[Accessibility ARIA Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "triggerPhrase": "Optimize \"Accessibility ARIA Patterns\". Target the failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\" or the typical verification command axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Accessibility ARIA Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Measure using axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Guard against: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Accessibility ARIA Patterns\" — benchmark axe-core before and after.",
        "\"Tune ARIA attribute refactor / keyboard navigation / focus management / screen reader test script performance\" — reduce cost/latency while monitoring Adding ARIA attributes that conflict with native HTML semantics (e."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:tune",
          "optimization",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "agent-tool-binding-tune",
      "name": "Agent Tool Binding & Dispatch: Tune",
      "category": "Optimization",
      "description": "[Agent Tool Binding & Dispatch] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "triggerPhrase": "Optimize \"Agent Tool Binding & Dispatch\". Target the failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\" or the typical verification command agent trace log + tool invocation frequency analysis + token cost audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Agent Tool Binding & Dispatch. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is router tool / domain group / dynamic tool injection / tool usage statistics. Measure using agent trace log + tool invocation frequency analysis + token cost audit. Guard against: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Agent Tool Binding & Dispatch\" — benchmark agent trace log before and after.",
        "\"Tune router tool / domain group / dynamic tool injection / tool usage statistics performance\" — reduce cost/latency while monitoring Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:agent-tool-binding",
          "workflow:tune",
          "optimization",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "analytics-metric-definition-tune",
      "name": "Analytics Metric Definitions: Tune",
      "category": "Optimization",
      "description": "[Analytics Metric Definitions] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "triggerPhrase": "Optimize \"Analytics Metric Definitions\". Target the failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\" or the typical verification command dbt docs generate + dbt test --select tag:metrics + metric comparison script. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Analytics Metric Definitions. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is metric definition / dbt model / SQL logic / dashboard tile / documentation. Measure using dbt docs generate + dbt test --select tag:metrics + metric comparison script. Guard against: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Analytics Metric Definitions\" — benchmark dbt docs generate before and after.",
        "\"Tune metric definition / dbt model / SQL logic / dashboard tile / documentation performance\" — reduce cost/latency while monitoring Different teams computing the same metric (e."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:tune",
          "optimization",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "adr-documentation-tune",
      "name": "Architecture Decision Records: Tune",
      "category": "Optimization",
      "description": "[Architecture Decision Records] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "triggerPhrase": "Optimize \"Architecture Decision Records\". Target the failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\" or the typical verification command adr-tools list + adr-tools generate + decision log index page. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Architecture Decision Records. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is ADR document / decision log / template / review workflow. Measure using adr-tools list + adr-tools generate + decision log index page. Guard against: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ADR document / decision log / template / review workflow this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Architecture Decision Records\" — benchmark adr-tools list before and after.",
        "\"Tune ADR document / decision log / template / review workflow performance\" — reduce cost/latency while monitoring Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:adr-documentation",
          "workflow:tune",
          "optimization",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "aws-lambda-cold-start-tune",
      "name": "AWS Lambda Cold Starts: Tune",
      "category": "Optimization",
      "description": "[AWS Lambda Cold Starts] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "triggerPhrase": "Optimize \"AWS Lambda Cold Starts\". Target the failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\" or the typical verification command AWS X-Ray trace + Lambda Insights + cold start dashboard. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising AWS Lambda Cold Starts. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Measure using AWS X-Ray trace + Lambda Insights + cold start dashboard. Guard against: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise AWS Lambda Cold Starts\" — benchmark AWS X-Ray trace before and after.",
        "\"Tune handler refactor / SnapStart config / Provisioned Concurrency / warmer function performance\" — reduce cost/latency while monitoring Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:tune",
          "optimization",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "azure-bicep-tune",
      "name": "Azure Bicep Infrastructure: Tune",
      "category": "Optimization",
      "description": "[Azure Bicep Infrastructure] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "triggerPhrase": "Optimize \"Azure Bicep Infrastructure\". Target the failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\" or the typical verification command az deployment group validate + az what-if + bicep build. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Azure Bicep Infrastructure. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is main.bicep / module / parameter file / azd template. Measure using az deployment group validate + az what-if + bicep build. Guard against: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific main.bicep / module / parameter file / azd template this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Azure Bicep Infrastructure\" — benchmark az deployment group validate before and after.",
        "\"Tune main.bicep / module / parameter file / azd template performance\" — reduce cost/latency while monitoring Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:azure-bicep",
          "workflow:tune",
          "optimization",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "browser-devtools-tune",
      "name": "Browser DevTools & Debugging: Tune",
      "category": "Optimization",
      "description": "[Browser DevTools & Debugging] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "triggerPhrase": "Optimize \"Browser DevTools & Debugging\". Target the failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\" or the typical verification command Chrome DevTools performance recording + memory heap snapshot + network throttle. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Browser DevTools & Debugging. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is debugging workflow / breakpoint guide / performance recording / memory snapshot. Measure using Chrome DevTools performance recording + memory heap snapshot + network throttle. Guard against: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Browser DevTools & Debugging\" — benchmark Chrome DevTools performance recording before and after.",
        "\"Tune debugging workflow / breakpoint guide / performance recording / memory snapshot performance\" — reduce cost/latency while monitoring Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:browser-devtools",
          "workflow:tune",
          "optimization",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cli-tool-design-tune",
      "name": "CLI Tool Design Patterns: Tune",
      "category": "Optimization",
      "description": "[CLI Tool Design Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "triggerPhrase": "Optimize \"CLI Tool Design Patterns\". Target the failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\" or the typical verification command echo $? after CLI run + stderr redirection test + --json output validation. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising CLI Tool Design Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is CLI scaffolding / argument parser / exit code handler / --json output mode. Measure using echo $? after CLI run + stderr redirection test + --json output validation. Guard against: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise CLI Tool Design Patterns\" — benchmark echo $? after CLI run before and after.",
        "\"Tune CLI scaffolding / argument parser / exit code handler / --json output mode performance\" — reduce cost/latency while monitoring Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cli-tool-design",
          "workflow:tune",
          "optimization",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cloud-cost-optimization-tune",
      "name": "Cloud Cost Optimisation: Tune",
      "category": "Optimization",
      "description": "[Cloud Cost Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "triggerPhrase": "Optimize \"Cloud Cost Optimisation\". Target the failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\" or the typical verification command cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Cloud Cost Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Measure using cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Guard against: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Cloud Cost Optimisation\" — benchmark cloud cost explorer before and after.",
        "\"Tune right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report performance\" — reduce cost/latency while monitoring Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:tune",
          "optimization",
          "cloud",
          "cost"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "code-review-checklist-tune",
      "name": "Code Review Checklist: Tune",
      "category": "Optimization",
      "description": "[Code Review Checklist] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "triggerPhrase": "Optimize \"Code Review Checklist\". Target the failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\" or the typical verification command git diff --stat + lint-staged + danger.js automated review + commitlint. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Code Review Checklist. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is review checklist / automated review comment / risk classification / diff summary. Measure using git diff --stat + lint-staged + danger.js automated review + commitlint. Guard against: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Code Review Checklist\" — benchmark git diff --stat before and after.",
        "\"Tune review checklist / automated review comment / risk classification / diff summary performance\" — reduce cost/latency while monitoring Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:code-review-checklist",
          "workflow:tune",
          "optimization",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "convex-functions-tune",
      "name": "Convex Functions & Mutations: Tune",
      "category": "Optimization",
      "description": "[Convex Functions & Mutations] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "triggerPhrase": "Optimize \"Convex Functions & Mutations\". Target the failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\" or the typical verification command npx convex dev + dashboard OCC conflict log + custom retry logic. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Convex Functions & Mutations. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is mutation / query / action / component / scheduler job. Measure using npx convex dev + dashboard OCC conflict log + custom retry logic. Guard against: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific mutation / query / action / component / scheduler job this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Convex Functions & Mutations\" — benchmark npx convex dev before and after.",
        "\"Tune mutation / query / action / component / scheduler job performance\" — reduce cost/latency while monitoring Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:convex-functions",
          "workflow:tune",
          "optimization",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cron-job-reliability-tune",
      "name": "Cron Job & Scheduled Task Reliability: Tune",
      "category": "Optimization",
      "description": "[Cron Job & Scheduled Task Reliability] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "triggerPhrase": "Optimize \"Cron Job & Scheduled Task Reliability\". Target the failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\" or the typical verification command tail -f /var/log/cron + systemctl status cron + idempotency test script. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Cron Job & Scheduled Task Reliability. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is crontab entry / log rotation / idempotency guard / failure alert integration. Measure using tail -f /var/log/cron + systemctl status cron + idempotency test script. Guard against: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Cron Job & Scheduled Task Reliability\" — benchmark tail -f /var/log/cron before and after.",
        "\"Tune crontab entry / log rotation / idempotency guard / failure alert integration performance\" — reduce cost/latency while monitoring Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cron-job-reliability",
          "workflow:tune",
          "optimization",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "css-layout-tune",
      "name": "CSS Layout & Responsiveness: Tune",
      "category": "Optimization",
      "description": "[CSS Layout & Responsiveness] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "triggerPhrase": "Optimize \"CSS Layout & Responsiveness\". Target the failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\" or the typical verification command Lighthouse mobile emulation + browser DevTools responsive mode. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising CSS Layout & Responsiveness. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is CSS layout refactor / responsive grid / container query implementation. Measure using Lighthouse mobile emulation + browser DevTools responsive mode. Guard against: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise CSS Layout & Responsiveness\" — benchmark Lighthouse mobile emulation before and after.",
        "\"Tune CSS layout refactor / responsive grid / container query implementation performance\" — reduce cost/latency while monitoring Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:css-layout",
          "workflow:tune",
          "optimization",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "csv-data-cleaning-tune",
      "name": "CSV Data Cleaning Pipeline: Tune",
      "category": "Optimization",
      "description": "[CSV Data Cleaning Pipeline] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "triggerPhrase": "Optimize \"CSV Data Cleaning Pipeline\". Target the failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\" or the typical verification command python3 -c csv.DictReader + validation script + row count diff. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising CSV Data Cleaning Pipeline. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is CSV parser / row validator / column type mapper / error report / cleaned output. Measure using python3 -c csv.DictReader + validation script + row count diff. Guard against: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise CSV Data Cleaning Pipeline\" — benchmark python3 -c csv.DictReader before and after.",
        "\"Tune CSV parser / row validator / column type mapper / error report / cleaned output performance\" — reduce cost/latency while monitoring Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:tune",
          "optimization",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "database-migration-safety-tune",
      "name": "Database Migration Safety: Tune",
      "category": "Optimization",
      "description": "[Database Migration Safety] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "triggerPhrase": "Optimize \"Database Migration Safety\". Target the failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\" or the typical verification command pg_locks monitoring during migration + batch backfill script + rollback test. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Database Migration Safety. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Measure using pg_locks monitoring during migration + batch backfill script + rollback test. Guard against: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Database Migration Safety\" — benchmark pg_locks monitoring during migration before and after.",
        "\"Tune batch migration / expand-contract pattern / zero-downtime migration / rollback plan performance\" — reduce cost/latency while monitoring Running a long-running migration (e."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:database-migration-safety",
          "workflow:tune",
          "optimization",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "data-warehouse-schema-tune",
      "name": "Data Warehouse Schema Design: Tune",
      "category": "Optimization",
      "description": "[Data Warehouse Schema Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "triggerPhrase": "Optimize \"Data Warehouse Schema Design\". Target the failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\" or the typical verification command dbt run + dbt test + query profiling with warehouse-native tools. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Data Warehouse Schema Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is star schema / fact table / dimension table / ETL pipeline spec. Measure using dbt run + dbt test + query profiling with warehouse-native tools. Guard against: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Data Warehouse Schema Design\" — benchmark dbt run before and after.",
        "\"Tune star schema / fact table / dimension table / ETL pipeline spec performance\" — reduce cost/latency while monitoring Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:tune",
          "optimization",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "design-token-system-tune",
      "name": "Design Token Systems: Tune",
      "category": "Optimization",
      "description": "[Design Token Systems] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "triggerPhrase": "Optimize \"Design Token Systems\". Target the failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\" or the typical verification command style-dictionary build + Storybook token viewer + token value comparison. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Design Token Systems. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is token JSON / CSS custom properties / theme switcher / token documentation. Measure using style-dictionary build + Storybook token viewer + token value comparison. Guard against: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Design Token Systems\" — benchmark style-dictionary build before and after.",
        "\"Tune token JSON / CSS custom properties / theme switcher / token documentation performance\" — reduce cost/latency while monitoring Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:design-token-system",
          "workflow:tune",
          "optimization",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-compose-networking-tune",
      "name": "Docker Compose Networking: Tune",
      "category": "Optimization",
      "description": "[Docker Compose Networking] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "triggerPhrase": "Optimize \"Docker Compose Networking\". Target the failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\" or the typical verification command docker compose up --wait + docker network inspect + container logs. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Docker Compose Networking. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is docker-compose.yml / network config / healthcheck / depends_on condition. Measure using docker compose up --wait + docker network inspect + container logs. Guard against: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Docker Compose Networking\" — benchmark docker compose up --wait before and after.",
        "\"Tune docker-compose.yml / network config / healthcheck / depends_on condition performance\" — reduce cost/latency while monitoring Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-compose-networking",
          "workflow:tune",
          "optimization",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-multistage-tune",
      "name": "Docker Multi-Stage Builds: Tune",
      "category": "Optimization",
      "description": "[Docker Multi-Stage Builds] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "triggerPhrase": "Optimize \"Docker Multi-Stage Builds\". Target the failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\" or the typical verification command docker build + docker scout + dive layer analysis. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Docker Multi-Stage Builds. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is multi-stage Dockerfile / .dockerignore / slim base image switch. Measure using docker build + docker scout + dive layer analysis. Guard against: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Docker Multi-Stage Builds\" — benchmark docker build before and after.",
        "\"Tune multi-stage Dockerfile / .dockerignore / slim base image switch performance\" — reduce cost/latency while monitoring Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-multistage",
          "workflow:tune",
          "optimization",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "drizzle-schema-design-tune",
      "name": "Drizzle Schema Design: Tune",
      "category": "Optimization",
      "description": "[Drizzle Schema Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "triggerPhrase": "Optimize \"Drizzle Schema Design\". Target the failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\" or the typical verification command drizzle-kit push + drizzle-kit studio + generated SQL audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Drizzle Schema Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is schema.ts / relation map / migration SQL / Drizzle query builder. Measure using drizzle-kit push + drizzle-kit studio + generated SQL audit. Guard against: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Drizzle Schema Design\" — benchmark drizzle-kit push before and after.",
        "\"Tune schema.ts / relation map / migration SQL / Drizzle query builder performance\" — reduce cost/latency while monitoring Over-using relations() when simple foreign key columns with manual joins would be clearer and faster."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:tune",
          "optimization",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "error-monitoring-setup-tune",
      "name": "Error Monitoring & Alerting Setup: Tune",
      "category": "Optimization",
      "description": "[Error Monitoring & Alerting Setup] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "triggerPhrase": "Optimize \"Error Monitoring & Alerting Setup\". Target the failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\" or the typical verification command Sentry API error list + alert rule test + source map validation. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Error Monitoring & Alerting Setup. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Measure using Sentry API error list + alert rule test + source map validation. Guard against: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Error Monitoring & Alerting Setup\" — benchmark Sentry API error list before and after.",
        "\"Tune Sentry project config / alert rule / error grouping / source map upload / performance monitoring performance\" — reduce cost/latency while monitoring Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:tune",
          "optimization",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "fastapi-dependencies-tune",
      "name": "FastAPI Dependency Injection: Tune",
      "category": "Optimization",
      "description": "[FastAPI Dependency Injection] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "triggerPhrase": "Optimize \"FastAPI Dependency Injection\". Target the failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\" or the typical verification command uvicorn --reload + /docs interactive test + dependency graph visualisation. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising FastAPI Dependency Injection. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is dependency / lifespan handler / override for testing. Measure using uvicorn --reload + /docs interactive test + dependency graph visualisation. Guard against: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific dependency / lifespan handler / override for testing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise FastAPI Dependency Injection\" — benchmark uvicorn --reload before and after.",
        "\"Tune dependency / lifespan handler / override for testing performance\" — reduce cost/latency while monitoring Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:tune",
          "optimization",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "feature-flags-tune",
      "name": "Feature Flags & Gradual Rollouts: Tune",
      "category": "Optimization",
      "description": "[Feature Flags & Gradual Rollouts] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "triggerPhrase": "Optimize \"Feature Flags & Gradual Rollouts\". Target the failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\" or the typical verification command flag evaluation log + rollout percentage monitoring + unused flag scan. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Feature Flags & Gradual Rollouts. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Measure using flag evaluation log + rollout percentage monitoring + unused flag scan. Guard against: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Feature Flags & Gradual Rollouts\" — benchmark flag evaluation log before and after.",
        "\"Tune flag provider config / gradual rollout target / flag cleanup plan / A/B test flag performance\" — reduce cost/latency while monitoring Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:feature-flags",
          "workflow:tune",
          "optimization",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "git-conflict-resolution-tune",
      "name": "Git Conflict Resolution: Tune",
      "category": "Optimization",
      "description": "[Git Conflict Resolution] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "triggerPhrase": "Optimize \"Git Conflict Resolution\". Target the failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\" or the typical verification command git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Git Conflict Resolution. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Measure using git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Guard against: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Git Conflict Resolution\" — benchmark git log --oneline -5 -- <file> before and after.",
        "\"Tune conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message performance\" — reduce cost/latency while monitoring Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:tune",
          "optimization",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "github-actions-pipeline-tune",
      "name": "GitHub Actions Pipeline Optimisation: Tune",
      "category": "Optimization",
      "description": "[GitHub Actions Pipeline Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "triggerPhrase": "Optimize \"GitHub Actions Pipeline Optimisation\". Target the failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\" or the typical verification command act --job test + cache hit/miss analysis + workflow graph visualisation. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising GitHub Actions Pipeline Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is workflow YAML / cache config / matrix build / conditional job execution. Measure using act --job test + cache hit/miss analysis + workflow graph visualisation. Guard against: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise GitHub Actions Pipeline Optimisation\" — benchmark act --job test before and after.",
        "\"Tune workflow YAML / cache config / matrix build / conditional job execution performance\" — reduce cost/latency while monitoring Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:tune",
          "optimization",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "graphql-n-plus-one-tune",
      "name": "GraphQL N+1 Query Prevention: Tune",
      "category": "Optimization",
      "description": "[GraphQL N+1 Query Prevention] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "triggerPhrase": "Optimize \"GraphQL N+1 Query Prevention\". Target the failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\" or the typical verification command graphql query with tracing + DataLoader statistics + SQL log analysis. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising GraphQL N+1 Query Prevention. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Measure using graphql query with tracing + DataLoader statistics + SQL log analysis. Guard against: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise GraphQL N+1 Query Prevention\" — benchmark graphql query with tracing before and after.",
        "\"Tune DataLoader instance / batch load function / resolver refactor / query complexity analysis performance\" — reduce cost/latency while monitoring A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:tune",
          "optimization",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "jest-test-optimization-tune",
      "name": "Jest Test Optimisation: Tune",
      "category": "Optimization",
      "description": "[Jest Test Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "triggerPhrase": "Optimize \"Jest Test Optimisation\". Target the failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\" or the typical verification command jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Jest Test Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Measure using jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Guard against: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Jest Test Optimisation\" — benchmark jest --changedSince=main --json before and after.",
        "\"Tune jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking performance\" — reduce cost/latency while monitoring Running the entire test suite on every change, taking minutes even for small incremental code changes."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:jest-test-optimization",
          "workflow:tune",
          "optimization",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "json-schema-validation-tune",
      "name": "JSON Schema Validation: Tune",
      "category": "Optimization",
      "description": "[JSON Schema Validation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "triggerPhrase": "Optimize \"JSON Schema Validation\". Target the failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\" or the typical verification command ajv validate + JSON Schema test suite + response mock test. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising JSON Schema Validation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is JSON Schema / validator middleware / type guard / error message / response parser. Measure using ajv validate + JSON Schema test suite + response mock test. Guard against: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise JSON Schema Validation\" — benchmark ajv validate before and after.",
        "\"Tune JSON Schema / validator middleware / type guard / error message / response parser performance\" — reduce cost/latency while monitoring Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:json-schema-validation",
          "workflow:tune",
          "optimization",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-hpa-tune",
      "name": "Kubernetes Horizontal Pod Autoscaling: Tune",
      "category": "Optimization",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "triggerPhrase": "Optimize \"Kubernetes Horizontal Pod Autoscaling\". Target the failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\" or the typical verification command kubectl get hpa --watch + kubectl top pods + metrics-server logs. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Kubernetes Horizontal Pod Autoscaling. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Measure using kubectl get hpa --watch + kubectl top pods + metrics-server logs. Guard against: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Kubernetes Horizontal Pod Autoscaling\" — benchmark kubectl get hpa --watch before and after.",
        "\"Tune HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config performance\" — reduce cost/latency while monitoring HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:tune",
          "optimization",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-pod-lifecycle-tune",
      "name": "Kubernetes Pod Lifecycle: Tune",
      "category": "Optimization",
      "description": "[Kubernetes Pod Lifecycle] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "triggerPhrase": "Optimize \"Kubernetes Pod Lifecycle\". Target the failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\" or the typical verification command kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Kubernetes Pod Lifecycle. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Measure using kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Guard against: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Kubernetes Pod Lifecycle\" — benchmark kubectl describe pod before and after.",
        "\"Tune deployment.yaml / startup probe / readiness probe / liveness probe / init container performance\" — reduce cost/latency while monitoring Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:tune",
          "optimization",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "context-window-budget-tune",
      "name": "LLM Context Window Budget Management: Tune",
      "category": "Optimization",
      "description": "[LLM Context Window Budget Management] Measure baseline, optimise with non-breaking changes, measure again, report before/after Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "triggerPhrase": "Optimise \"LLM Context Window Budget Management\". Target the failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\" or the typical verification command tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising LLM Context Window Budget Management. Measure baseline, optimise with non-breaking changes, measure again, report before/after. The target is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Measure using tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Guard against: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "command",
          "name": "cmd",
          "description": "CMD output"
        }
      ],
      "examples": [
        "\"Optimise LLM Context Window Budget Management\" — benchmark tiktoken count before and after.",
        "\"Tune trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard performance\" — reduce cost/latency while monitoring Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:context-window-budget",
          "workflow:tune",
          "optimization",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "mcp-tool-design-tune",
      "name": "MCP Tool Design & Best Practices: Tune",
      "category": "Optimization",
      "description": "[MCP Tool Design & Best Practices] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "triggerPhrase": "Optimize \"MCP Tool Design & Best Practices\". Target the failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\" or the typical verification command mcp-cli run + mcp inspector + tool name conflict analysis. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising MCP Tool Design & Best Practices. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is MCP tool descriptor / resource definition / prompt template / server metadata. Measure using mcp-cli run + mcp inspector + tool name conflict analysis. Guard against: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise MCP Tool Design & Best Practices\" — benchmark mcp-cli run before and after.",
        "\"Tune MCP tool descriptor / resource definition / prompt template / server metadata performance\" — reduce cost/latency while monitoring Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:mcp-tool-design",
          "workflow:tune",
          "optimization",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "message-queues-tune",
      "name": "Message Queues & Background Jobs: Tune",
      "category": "Optimization",
      "description": "[Message Queues & Background Jobs] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "triggerPhrase": "Optimize \"Message Queues & Background Jobs\". Target the failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\" or the typical verification command Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Message Queues & Background Jobs. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is queue producer / worker / dead-letter handler / retry policy. Measure using Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Guard against: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Message Queues & Background Jobs\" — benchmark Bull/BullMQ dashboard before and after.",
        "\"Tune queue producer / worker / dead-letter handler / retry policy performance\" — reduce cost/latency while monitoring Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:message-queues",
          "workflow:tune",
          "optimization",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "multi-tenant-isolation-tune",
      "name": "Multi-Tenant Data Isolation: Tune",
      "category": "Optimization",
      "description": "[Multi-Tenant Data Isolation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "triggerPhrase": "Optimize \"Multi-Tenant Data Isolation\". Target the failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\" or the typical verification command RLS policy test with two different tenant sessions + data leakage check. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Multi-Tenant Data Isolation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Measure using RLS policy test with two different tenant sessions + data leakage check. Guard against: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Multi-Tenant Data Isolation\" — benchmark RLS policy test with two different tenant sessions before and after.",
        "\"Tune RLS policy / tenant context middleware / session variable injection / tenant-aware query builder performance\" — reduce cost/latency while monitoring Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:tune",
          "optimization",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-api-routes-tune",
      "name": "Next.js API Routes & Route Handlers: Tune",
      "category": "Optimization",
      "description": "[Next.js API Routes & Route Handlers] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "triggerPhrase": "Optimize \"Next.js API Routes & Route Handlers\". Target the failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\" or the typical verification command curl --verbose + API route error log + status code audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Next.js API Routes & Route Handlers. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is route.ts handler / server action / API client wrapper / error boundary. Measure using curl --verbose + API route error log + status code audit. Guard against: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Next.js API Routes & Route Handlers\" — benchmark curl --verbose before and after.",
        "\"Tune route.ts handler / server action / API client wrapper / error boundary performance\" — reduce cost/latency while monitoring Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:tune",
          "optimization",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-data-fetching-tune",
      "name": "Next.js Data Fetching Patterns: Tune",
      "category": "Optimization",
      "description": "[Next.js Data Fetching Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "triggerPhrase": "Optimize \"Next.js Data Fetching Patterns\". Target the failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\" or the typical verification command next build --debug + React DevTools fetch profiling. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Next.js Data Fetching Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is server fetch / React cache wrapper / streaming suspense boundary. Measure using next build --debug + React DevTools fetch profiling. Guard against: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Next.js Data Fetching Patterns\" — benchmark next build --debug before and after.",
        "\"Tune server fetch / React cache wrapper / streaming suspense boundary performance\" — reduce cost/latency while monitoring Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:tune",
          "optimization",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-middleware-tune",
      "name": "Next.js Middleware & Edge Runtime: Tune",
      "category": "Optimization",
      "description": "[Next.js Middleware & Edge Runtime] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "triggerPhrase": "Optimize \"Next.js Middleware & Edge Runtime\". Target the failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\" or the typical verification command next dev + curl --cookie tests + edge runtime log inspection. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Next.js Middleware & Edge Runtime. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Measure using next dev + curl --cookie tests + edge runtime log inspection. Guard against: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Next.js Middleware & Edge Runtime\" — benchmark next dev before and after.",
        "\"Tune middleware.ts / rewrite rule / cookie-based redirect / geolocation routing performance\" — reduce cost/latency while monitoring Using Node."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-middleware",
          "workflow:tune",
          "optimization",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-error-handling-tune",
      "name": "Node.js Error Handling & Resilience: Tune",
      "category": "Optimization",
      "description": "[Node.js Error Handling & Resilience] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "triggerPhrase": "Optimize \"Node.js Error Handling & Resilience\". Target the failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\" or the typical verification command node --unhandled-rejections=strict + process.on('uncaughtException') log. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Node.js Error Handling & Resilience. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is global error handler / async wrapper / structured error response / retry logic. Measure using node --unhandled-rejections=strict + process.on('uncaughtException') log. Guard against: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Node.js Error Handling & Resilience\" — benchmark node --unhandled-rejections=strict before and after.",
        "\"Tune global error handler / async wrapper / structured error response / retry logic performance\" — reduce cost/latency while monitoring Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-error-handling",
          "workflow:tune",
          "optimization",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-streams-tune",
      "name": "Node.js Streams & Backpressure: Tune",
      "category": "Optimization",
      "description": "[Node.js Streams & Backpressure] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "triggerPhrase": "Optimize \"Node.js Streams & Backpressure\". Target the failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\" or the typical verification command Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Node.js Streams & Backpressure. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is Readable/Writable stream / Transform / pipeline() refactor. Measure using Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Guard against: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Node.js Streams & Backpressure\" — benchmark Node.js --inspect memory heap snapshot before and after.",
        "\"Tune Readable/Writable stream / Transform / pipeline() refactor performance\" — reduce cost/latency while monitoring Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-streams",
          "workflow:tune",
          "optimization",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "oauth-flows-tune",
      "name": "OAuth 2.0 Flows & Token Management: Tune",
      "category": "Optimization",
      "description": "[OAuth 2.0 Flows & Token Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "triggerPhrase": "Optimize \"OAuth 2.0 Flows & Token Management\". Target the failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\" or the typical verification command oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising OAuth 2.0 Flows & Token Management. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Measure using oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Guard against: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise OAuth 2.0 Flows & Token Management\" — benchmark oauth2_proxy before and after.",
        "\"Tune OAuth callback / token refresh / PKCE flow / httpOnly cookie handler performance\" — reduce cost/latency while monitoring Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:oauth-flows",
          "workflow:tune",
          "optimization",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "openapi-spec-tune",
      "name": "OpenAPI Specification & Validation: Tune",
      "category": "Optimization",
      "description": "[OpenAPI Specification & Validation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "triggerPhrase": "Optimize \"OpenAPI Specification & Validation\". Target the failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\" or the typical verification command redocly lint + openapi-diff + swagger-ui preview. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising OpenAPI Specification & Validation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is openapi.yaml / code-first generator / request/response validation middleware. Measure using redocly lint + openapi-diff + swagger-ui preview. Guard against: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise OpenAPI Specification & Validation\" — benchmark redocly lint before and after.",
        "\"Tune openapi.yaml / code-first generator / request/response validation middleware performance\" — reduce cost/latency while monitoring Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:openapi-spec",
          "workflow:tune",
          "optimization",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "playwright-selectors-tune",
      "name": "Playwright Selectors & Locators: Tune",
      "category": "Optimization",
      "description": "[Playwright Selectors & Locators] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "triggerPhrase": "Optimize \"Playwright Selectors & Locators\". Target the failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\" or the typical verification command playwright test --reporter=html + playwright codegen + trace viewer. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Playwright Selectors & Locators. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Measure using playwright test --reporter=html + playwright codegen + trace viewer. Guard against: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Playwright Selectors & Locators\" — benchmark playwright test --reporter=html before and after.",
        "\"Tune locator refactor / test fixture / POM (Page Object Model) / custom fixture performance\" — reduce cost/latency while monitoring Using fragile CSS selectors (nth-child, class names that change) that break on every UI update."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:playwright-selectors",
          "workflow:tune",
          "optimization",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "prompt-injection-defense-tune",
      "name": "Prompt Injection Defense: Tune",
      "category": "Optimization",
      "description": "[Prompt Injection Defense] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "triggerPhrase": "Optimize \"Prompt Injection Defense\". Target the failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\" or the typical verification command prompt injection test suite + adversarial input fuzzing + output scanner. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Prompt Injection Defense. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is defensive system prompt / input sanitizer / instruction guardrail / output validator. Measure using prompt injection test suite + adversarial input fuzzing + output scanner. Guard against: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Prompt Injection Defense\" — benchmark prompt injection test suite before and after.",
        "\"Tune defensive system prompt / input sanitizer / instruction guardrail / output validator performance\" — reduce cost/latency while monitoring Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:tune",
          "optimization",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-async-tune",
      "name": "Python Async/Await Patterns: Tune",
      "category": "Optimization",
      "description": "[Python Async/Await Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "triggerPhrase": "Optimize \"Python Async/Await Patterns\". Target the failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\" or the typical verification command python3 -m asyncio + aiohttp/httpx async benchmark. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Python Async/Await Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is async/await refactor / asyncio.gather / async context manager. Measure using python3 -m asyncio + aiohttp/httpx async benchmark. Guard against: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Python Async/Await Patterns\" — benchmark python3 -m asyncio before and after.",
        "\"Tune async/await refactor / asyncio.gather / async context manager performance\" — reduce cost/latency while monitoring Blocking the event loop by using synchronous requests or time."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-async",
          "workflow:tune",
          "optimization",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-file-io-tune",
      "name": "Python File I/O & Encoding: Tune",
      "category": "Optimization",
      "description": "[Python File I/O & Encoding] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "triggerPhrase": "Optimize \"Python File I/O & Encoding\". Target the failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\" or the typical verification command python3 -c with open() + chardet encoding detection. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Python File I/O & Encoding. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is pathlib refactor / encoding-safe file reader / batch file processor. Measure using python3 -c with open() + chardet encoding detection. Guard against: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Python File I/O & Encoding\" — benchmark python3 -c with open() before and after.",
        "\"Tune pathlib refactor / encoding-safe file reader / batch file processor performance\" — reduce cost/latency while monitoring Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-file-io",
          "workflow:tune",
          "optimization",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rag-chunking-tune",
      "name": "RAG Chunking Strategies: Tune",
      "category": "Optimization",
      "description": "[RAG Chunking Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "triggerPhrase": "Optimize \"RAG Chunking Strategies\". Target the failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\" or the typical verification command retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising RAG Chunking Strategies. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Measure using retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Guard against: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise RAG Chunking Strategies\" — benchmark retrieval evaluation script before and after.",
        "\"Tune semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment performance\" — reduce cost/latency while monitoring Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rag-chunking",
          "workflow:tune",
          "optimization",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rate-limiting-proxy-tune",
      "name": "Rate Limiting & API Gateway Proxy: Tune",
      "category": "Optimization",
      "description": "[Rate Limiting & API Gateway Proxy] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "triggerPhrase": "Optimize \"Rate Limiting & API Gateway Proxy\". Target the failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\" or the typical verification command ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Rate Limiting & API Gateway Proxy. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Measure using ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Guard against: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Rate Limiting & API Gateway Proxy\" — benchmark ab -n 1000 -c 10 before and after.",
        "\"Tune NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation performance\" — reduce cost/latency while monitoring Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:tune",
          "optimization",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-server-components-tune",
      "name": "React Server Components: Tune",
      "category": "Optimization",
      "description": "[React Server Components] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "triggerPhrase": "Optimize \"React Server Components\". Target the failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\" or the typical verification command next build --debug + React Server Components lint rule. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising React Server Components. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is server component / client boundary refactor / streaming fallback. Measure using next build --debug + React Server Components lint rule. Guard against: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise React Server Components\" — benchmark next build --debug before and after.",
        "\"Tune server component / client boundary refactor / streaming fallback performance\" — reduce cost/latency while monitoring Accidentally making a server component a client component by using hooks or event handlers in the wrong file."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-server-components",
          "workflow:tune",
          "optimization",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-state-tune",
      "name": "React State Management: Tune",
      "category": "Optimization",
      "description": "[React State Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "triggerPhrase": "Optimize \"React State Management\". Target the failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\" or the typical verification command React DevTools profiler + why-did-you-render. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising React State Management. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Measure using React DevTools profiler + why-did-you-render. Guard against: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise React State Management\" — benchmark React DevTools profiler before and after.",
        "\"Tune useState / useReducer / useContext hook refactor, zustand or jotai store slice performance\" — reduce cost/latency while monitoring Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-state",
          "workflow:tune",
          "optimization",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "redis-caching-tune",
      "name": "Redis Caching Strategies: Tune",
      "category": "Optimization",
      "description": "[Redis Caching Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "triggerPhrase": "Optimize \"Redis Caching Strategies\". Target the failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\" or the typical verification command redis-cli --stat + cache hit ratio monitoring + slow log. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Redis Caching Strategies. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Measure using redis-cli --stat + cache hit ratio monitoring + slow log. Guard against: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Redis Caching Strategies\" — benchmark redis-cli --stat before and after.",
        "\"Tune cache wrapper / mutex lock / stale-while-revalidate / TTL policy performance\" — reduce cost/latency while monitoring Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:redis-caching",
          "workflow:tune",
          "optimization",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rest-pagination-tune",
      "name": "REST Pagination Design: Tune",
      "category": "Optimization",
      "description": "[REST Pagination Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "triggerPhrase": "Optimize \"REST Pagination Design\". Target the failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\" or the typical verification command curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising REST Pagination Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Measure using curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Guard against: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise REST Pagination Design\" — benchmark curl with cursor param before and after.",
        "\"Tune cursor pagination / offset pagination fallback / total count optimisation / response envelope performance\" — reduce cost/latency while monitoring Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rest-pagination",
          "workflow:tune",
          "optimization",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "secrets-rotation-tune",
      "name": "Secrets Rotation Policy: Tune",
      "category": "Optimization",
      "description": "[Secrets Rotation Policy] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "triggerPhrase": "Optimize \"Secrets Rotation Policy\". Target the failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\" or the typical verification command vault lease list + secret expiry check + rotation dry-run test. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Secrets Rotation Policy. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is rotation script / vault integration / lease management / incident response plan. Measure using vault lease list + secret expiry check + rotation dry-run test. Guard against: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Secrets Rotation Policy\" — benchmark vault lease list before and after.",
        "\"Tune rotation script / vault integration / lease management / incident response plan performance\" — reduce cost/latency while monitoring Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:secrets-rotation",
          "workflow:tune",
          "optimization",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "shell-script-robustness-tune",
      "name": "Shell Script Robustness & Safety: Tune",
      "category": "Optimization",
      "description": "[Shell Script Robustness & Safety] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "triggerPhrase": "Optimize \"Shell Script Robustness & Safety\". Target the failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\" or the typical verification command shellcheck script.sh + bash -n script.sh + dry-run mode test. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Shell Script Robustness & Safety. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Measure using shellcheck script.sh + bash -n script.sh + dry-run mode test. Guard against: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Shell Script Robustness & Safety\" — benchmark shellcheck script.sh before and after.",
        "\"Tune set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function performance\" — reduce cost/latency while monitoring Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:shell-script-robustness",
          "workflow:tune",
          "optimization",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "sql-query-optimization-tune",
      "name": "SQL Query Optimisation: Tune",
      "category": "Optimization",
      "description": "[SQL Query Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "triggerPhrase": "Optimize \"SQL Query Optimisation\". Target the failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\" or the typical verification command EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising SQL Query Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Measure using EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Guard against: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise SQL Query Optimisation\" — benchmark EXPLAIN (ANALYSE, BUFFERS) before and after.",
        "\"Tune indexed query / composite index / EXPLAIN ANALYSE plan / partial index performance\" — reduce cost/latency while monitoring Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:sql-query-optimization",
          "workflow:tune",
          "optimization",
          "sql",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stealth-web-research-tune",
      "name": "Stealth Web Research & Harvesting: Tune",
      "category": "Optimization",
      "description": "[Stealth Web Research & Harvesting] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "triggerPhrase": "Optimize \"Stealth Web Research & Harvesting\". Target the failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\" or the typical verification command playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Stealth Web Research & Harvesting. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Measure using playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Guard against: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Stealth Web Research & Harvesting\" — benchmark playwright-extra before and after.",
        "\"Tune clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages performance\" — reduce cost/latency while monitoring Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stealth-web-research",
          "workflow:tune",
          "optimization",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stripe-webhook-idempotency-tune",
      "name": "Stripe Webhook Idempotency: Tune",
      "category": "Optimization",
      "description": "[Stripe Webhook Idempotency] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "triggerPhrase": "Optimize \"Stripe Webhook Idempotency\". Target the failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\" or the typical verification command stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Stripe Webhook Idempotency. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Measure using stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Guard against: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Stripe Webhook Idempotency\" — benchmark stripe trigger payment_intent.succeeded before and after.",
        "\"Tune Webhook handler / idempotency key check / event deduplication / failed payment recovery performance\" — reduce cost/latency while monitoring Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:tune",
          "optimization",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "supabase-rls-tune",
      "name": "Supabase Row-Level Security: Tune",
      "category": "Optimization",
      "description": "[Supabase Row-Level Security] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "triggerPhrase": "Optimize \"Supabase Row-Level Security\". Target the failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\" or the typical verification command supabase db check + supabase db test + RLS policy review with pg_policies. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Supabase Row-Level Security. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is RLS policy / policy test / security definer function / admin bypass. Measure using supabase db check + supabase db test + RLS policy review with pg_policies. Guard against: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Supabase Row-Level Security\" — benchmark supabase db check before and after.",
        "\"Tune RLS policy / policy test / security definer function / admin bypass performance\" — reduce cost/latency while monitoring RLS policies that are too permissive (using 'true' instead of 'auth."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:supabase-rls",
          "workflow:tune",
          "optimization",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "terraform-state-tune",
      "name": "Terraform State Management: Tune",
      "category": "Optimization",
      "description": "[Terraform State Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "triggerPhrase": "Optimize \"Terraform State Management\". Target the failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\" or the typical verification command terraform plan + terraform state list + terraform state pull | jq. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Terraform State Management. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is backend config / state migration plan / state locking config / remote state datasource. Measure using terraform plan + terraform state list + terraform state pull | jq. Guard against: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Terraform State Management\" — benchmark terraform plan before and after.",
        "\"Tune backend config / state migration plan / state locking config / remote state datasource performance\" — reduce cost/latency while monitoring Losing the ."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:terraform-state",
          "workflow:tune",
          "optimization",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "typescript-generics-tune",
      "name": "TypeScript Generics & Advanced Types: Tune",
      "category": "Optimization",
      "description": "[TypeScript Generics & Advanced Types] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "triggerPhrase": "Optimize \"TypeScript Generics & Advanced Types\". Target the failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\" or the typical verification command tsc --noEmit --strict + type tests with expect-type. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising TypeScript Generics & Advanced Types. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is generic type / conditional type / mapped type / branded type. Measure using tsc --noEmit --strict + type tests with expect-type. Guard against: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise TypeScript Generics & Advanced Types\" — benchmark tsc --noEmit --strict before and after.",
        "\"Tune generic type / conditional type / mapped type / branded type performance\" — reduce cost/latency while monitoring Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:typescript-generics",
          "workflow:tune",
          "optimization",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "user-onboarding-flow-tune",
      "name": "User Onboarding Flow Design: Tune",
      "category": "Optimization",
      "description": "[User Onboarding Flow Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "triggerPhrase": "Optimize \"User Onboarding Flow Design\". Target the failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\" or the typical verification command analytics funnel analysis + onboarding completion rate + drop-off heatmap. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising User Onboarding Flow Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Measure using analytics funnel analysis + onboarding completion rate + drop-off heatmap. Guard against: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise User Onboarding Flow Design\" — benchmark analytics funnel analysis before and after.",
        "\"Tune onboarding wizard / feature checklist / in-app guide / first-run experience spec performance\" — reduce cost/latency while monitoring Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:tune",
          "optimization",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "vercel-env-vars-tune",
      "name": "Vercel Environment Variables: Tune",
      "category": "Optimization",
      "description": "[Vercel Environment Variables] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "triggerPhrase": "Optimize \"Vercel Environment Variables\". Target the failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\" or the typical verification command vercel env pull + vercel list + project settings audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Vercel Environment Variables. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is vercel.json env group / preview env config / Edge Config / KV store. Measure using vercel env pull + vercel list + project settings audit. Guard against: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Vercel Environment Variables\" — benchmark vercel env pull before and after.",
        "\"Tune vercel.json env group / preview env config / Edge Config / KV store performance\" — reduce cost/latency while monitoring Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:vercel-env-vars",
          "workflow:tune",
          "optimization",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-scraping-ethics-tune",
      "name": "Web Scraping Ethics & Compliance: Tune",
      "category": "Optimization",
      "description": "[Web Scraping Ethics & Compliance] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "triggerPhrase": "Optimize \"Web Scraping Ethics & Compliance\". Target the failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\" or the typical verification command curl robots.txt + wget --wait + scraper log audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Web Scraping Ethics & Compliance. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Measure using curl robots.txt + wget --wait + scraper log audit. Guard against: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Web Scraping Ethics & Compliance\" — benchmark curl robots.txt before and after.",
        "\"Tune robots.txt check / polite scraper / rate-limited crawler / cached scraper performance\" — reduce cost/latency while monitoring Scraping a website that explicitly prohibits it in robots."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:tune",
          "optimization",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "websocket-reconnection-tune",
      "name": "WebSocket Reconnection Strategies: Tune",
      "category": "Optimization",
      "description": "[WebSocket Reconnection Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "triggerPhrase": "Optimize \"WebSocket Reconnection Strategies\". Target the failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\" or the typical verification command Browser DevTools Network tab WS filter + reconnection test with server restart. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising WebSocket Reconnection Strategies. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is WebSocket client / reconnection logic / heartbeat / connection status component. Measure using Browser DevTools Network tab WS filter + reconnection test with server restart. Guard against: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise WebSocket Reconnection Strategies\" — benchmark Browser DevTools Network tab WS filter before and after.",
        "\"Tune WebSocket client / reconnection logic / heartbeat / connection status component performance\" — reduce cost/latency while monitoring Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:websocket-reconnection",
          "workflow:tune",
          "optimization",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-vitals-optimization-tune",
      "name": "Web Vitals Optimisation (LCP/CLS/INP): Tune",
      "category": "Optimization",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "triggerPhrase": "Optimize \"Web Vitals Optimisation (LCP/CLS/INP)\". Target the failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\" or the typical verification command Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Benchmark before and after. Prefer non-breaking optimisations.",
      "promptTemplate": "You are optimising Web Vitals Optimisation (LCP/CLS/INP). Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Measure using Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Guard against: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Report before/after values.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Optimise Web Vitals Optimisation (LCP/CLS/INP)\" — benchmark Lighthouse CI before and after.",
        "\"Tune image optimisation / font display swap / critical CSS / lazy load / bundle analysis performance\" — reduce cost/latency while monitoring Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:tune",
          "optimization",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "intent-router",
      "name": "Intent Router",
      "category": "Orchestration",
      "description": "Analyses a user request, determines the most appropriate skill to invoke, and produces a ranked execution plan. Prevents unnecessary agent context switching by grouping related sub-tasks under a single skill.",
      "triggerPhrase": "Call this when a user request is vague, multi-layered, or when you are unsure which specialised skill applies.",
      "promptTemplate": "Read the full request. Identify the primary intent (create, debug, refactor, document, secure, optimise). Determine the target layer (frontend, backend, data, infra, AI, docs). Choose the single best matching skill slug. Explain the choice in one sentence. If multiple skills could apply, rank them and output a sequence. Never default to asking clarifying questions if a safe fallback exists.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "User asks 'set up authentication for my app' → route to oauth-auth-guardian.",
        "User says 'the build is failing' → route to incident-debugger."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "router",
          "orchestration",
          "classification"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a-b-testing-framework-plan",
      "name": "A/B Testing Framework: Plan",
      "category": "Planning",
      "description": "[A/B Testing Framework] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "triggerPhrase": "A change to \"A/B Testing Framework\" needs to be designed first. Consider the common failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\" and the best practice \"Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for A/B Testing Framework. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. The output artifact is experiment spec / variant assignment / metric definition / statistical analysis script. Consider the failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the A/B Testing Framework feature\" — produce a step-by-step implementation sequence with experiment spec / variant assignment / metric definition / statistical analysis script as the target.",
        "\"Design A/B Testing Framework changes\" — document trade-offs, addressing Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:plan",
          "planning",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a11y-aria-patterns-plan",
      "name": "Accessibility ARIA Patterns: Plan",
      "category": "Planning",
      "description": "[Accessibility ARIA Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "triggerPhrase": "A change to \"Accessibility ARIA Patterns\" needs to be designed first. Consider the common failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\" and the best practice \"Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Accessibility ARIA Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. The output artifact is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Consider the failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Accessibility ARIA Patterns feature\" — produce a step-by-step implementation sequence with ARIA attribute refactor / keyboard navigation / focus management / screen reader test script as the target.",
        "\"Design Accessibility ARIA Patterns changes\" — document trade-offs, addressing Adding ARIA attributes that conflict with native HTML semantics (e."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:plan",
          "planning",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "agent-tool-binding-plan",
      "name": "Agent Tool Binding & Dispatch: Plan",
      "category": "Planning",
      "description": "[Agent Tool Binding & Dispatch] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "triggerPhrase": "A change to \"Agent Tool Binding & Dispatch\" needs to be designed first. Consider the common failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\" and the best practice \"Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Agent Tool Binding & Dispatch. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. The output artifact is router tool / domain group / dynamic tool injection / tool usage statistics. Consider the failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Agent Tool Binding & Dispatch feature\" — produce a step-by-step implementation sequence with router tool / domain group / dynamic tool injection / tool usage statistics as the target.",
        "\"Design Agent Tool Binding & Dispatch changes\" — document trade-offs, addressing Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:agent-tool-binding",
          "workflow:plan",
          "planning",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "analytics-metric-definition-plan",
      "name": "Analytics Metric Definitions: Plan",
      "category": "Planning",
      "description": "[Analytics Metric Definitions] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "triggerPhrase": "A change to \"Analytics Metric Definitions\" needs to be designed first. Consider the common failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\" and the best practice \"Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Analytics Metric Definitions. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. The output artifact is metric definition / dbt model / SQL logic / dashboard tile / documentation. Consider the failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Analytics Metric Definitions feature\" — produce a step-by-step implementation sequence with metric definition / dbt model / SQL logic / dashboard tile / documentation as the target.",
        "\"Design Analytics Metric Definitions changes\" — document trade-offs, addressing Different teams computing the same metric (e."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:plan",
          "planning",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "adr-documentation-plan",
      "name": "Architecture Decision Records: Plan",
      "category": "Planning",
      "description": "[Architecture Decision Records] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "triggerPhrase": "A change to \"Architecture Decision Records\" needs to be designed first. Consider the common failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\" and the best practice \"Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Architecture Decision Records. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. The output artifact is ADR document / decision log / template / review workflow. Consider the failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ADR document / decision log / template / review workflow this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Architecture Decision Records feature\" — produce a step-by-step implementation sequence with ADR document / decision log / template / review workflow as the target.",
        "\"Design Architecture Decision Records changes\" — document trade-offs, addressing Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:adr-documentation",
          "workflow:plan",
          "planning",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "aws-lambda-cold-start-plan",
      "name": "AWS Lambda Cold Starts: Plan",
      "category": "Planning",
      "description": "[AWS Lambda Cold Starts] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "triggerPhrase": "A change to \"AWS Lambda Cold Starts\" needs to be designed first. Consider the common failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\" and the best practice \"Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for AWS Lambda Cold Starts. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. The output artifact is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Consider the failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the AWS Lambda Cold Starts feature\" — produce a step-by-step implementation sequence with handler refactor / SnapStart config / Provisioned Concurrency / warmer function as the target.",
        "\"Design AWS Lambda Cold Starts changes\" — document trade-offs, addressing Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:plan",
          "planning",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "azure-bicep-plan",
      "name": "Azure Bicep Infrastructure: Plan",
      "category": "Planning",
      "description": "[Azure Bicep Infrastructure] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "triggerPhrase": "A change to \"Azure Bicep Infrastructure\" needs to be designed first. Consider the common failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\" and the best practice \"Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Azure Bicep Infrastructure. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. The output artifact is main.bicep / module / parameter file / azd template. Consider the failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific main.bicep / module / parameter file / azd template this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Azure Bicep Infrastructure feature\" — produce a step-by-step implementation sequence with main.bicep / module / parameter file / azd template as the target.",
        "\"Design Azure Bicep Infrastructure changes\" — document trade-offs, addressing Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:azure-bicep",
          "workflow:plan",
          "planning",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "browser-devtools-plan",
      "name": "Browser DevTools & Debugging: Plan",
      "category": "Planning",
      "description": "[Browser DevTools & Debugging] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "triggerPhrase": "A change to \"Browser DevTools & Debugging\" needs to be designed first. Consider the common failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\" and the best practice \"Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Browser DevTools & Debugging. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. The output artifact is debugging workflow / breakpoint guide / performance recording / memory snapshot. Consider the failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Browser DevTools & Debugging feature\" — produce a step-by-step implementation sequence with debugging workflow / breakpoint guide / performance recording / memory snapshot as the target.",
        "\"Design Browser DevTools & Debugging changes\" — document trade-offs, addressing Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:browser-devtools",
          "workflow:plan",
          "planning",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cli-tool-design-plan",
      "name": "CLI Tool Design Patterns: Plan",
      "category": "Planning",
      "description": "[CLI Tool Design Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "triggerPhrase": "A change to \"CLI Tool Design Patterns\" needs to be designed first. Consider the common failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\" and the best practice \"Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for CLI Tool Design Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. The output artifact is CLI scaffolding / argument parser / exit code handler / --json output mode. Consider the failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the CLI Tool Design Patterns feature\" — produce a step-by-step implementation sequence with CLI scaffolding / argument parser / exit code handler / --json output mode as the target.",
        "\"Design CLI Tool Design Patterns changes\" — document trade-offs, addressing Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cli-tool-design",
          "workflow:plan",
          "planning",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cloud-cost-optimization-plan",
      "name": "Cloud Cost Optimisation: Plan",
      "category": "Planning",
      "description": "[Cloud Cost Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "triggerPhrase": "A change to \"Cloud Cost Optimisation\" needs to be designed first. Consider the common failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\" and the best practice \"Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Cloud Cost Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. The output artifact is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Consider the failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Cloud Cost Optimisation feature\" — produce a step-by-step implementation sequence with right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report as the target.",
        "\"Design Cloud Cost Optimisation changes\" — document trade-offs, addressing Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:plan",
          "planning",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "code-review-checklist-plan",
      "name": "Code Review Checklist: Plan",
      "category": "Planning",
      "description": "[Code Review Checklist] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "triggerPhrase": "A change to \"Code Review Checklist\" needs to be designed first. Consider the common failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\" and the best practice \"Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Code Review Checklist. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. The output artifact is review checklist / automated review comment / risk classification / diff summary. Consider the failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Code Review Checklist feature\" — produce a step-by-step implementation sequence with review checklist / automated review comment / risk classification / diff summary as the target.",
        "\"Design Code Review Checklist changes\" — document trade-offs, addressing Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:code-review-checklist",
          "workflow:plan",
          "planning",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "convex-functions-plan",
      "name": "Convex Functions & Mutations: Plan",
      "category": "Planning",
      "description": "[Convex Functions & Mutations] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "triggerPhrase": "A change to \"Convex Functions & Mutations\" needs to be designed first. Consider the common failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\" and the best practice \"Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Convex Functions & Mutations. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. The output artifact is mutation / query / action / component / scheduler job. Consider the failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific mutation / query / action / component / scheduler job this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Convex Functions & Mutations feature\" — produce a step-by-step implementation sequence with mutation / query / action / component / scheduler job as the target.",
        "\"Design Convex Functions & Mutations changes\" — document trade-offs, addressing Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:convex-functions",
          "workflow:plan",
          "planning",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cron-job-reliability-plan",
      "name": "Cron Job & Scheduled Task Reliability: Plan",
      "category": "Planning",
      "description": "[Cron Job & Scheduled Task Reliability] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "triggerPhrase": "A change to \"Cron Job & Scheduled Task Reliability\" needs to be designed first. Consider the common failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\" and the best practice \"Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Cron Job & Scheduled Task Reliability. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. The output artifact is crontab entry / log rotation / idempotency guard / failure alert integration. Consider the failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Cron Job & Scheduled Task Reliability feature\" — produce a step-by-step implementation sequence with crontab entry / log rotation / idempotency guard / failure alert integration as the target.",
        "\"Design Cron Job & Scheduled Task Reliability changes\" — document trade-offs, addressing Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cron-job-reliability",
          "workflow:plan",
          "planning",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "css-layout-plan",
      "name": "CSS Layout & Responsiveness: Plan",
      "category": "Planning",
      "description": "[CSS Layout & Responsiveness] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "triggerPhrase": "A change to \"CSS Layout & Responsiveness\" needs to be designed first. Consider the common failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\" and the best practice \"Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for CSS Layout & Responsiveness. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. The output artifact is CSS layout refactor / responsive grid / container query implementation. Consider the failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the CSS Layout & Responsiveness feature\" — produce a step-by-step implementation sequence with CSS layout refactor / responsive grid / container query implementation as the target.",
        "\"Design CSS Layout & Responsiveness changes\" — document trade-offs, addressing Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:css-layout",
          "workflow:plan",
          "planning",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "csv-data-cleaning-plan",
      "name": "CSV Data Cleaning Pipeline: Plan",
      "category": "Planning",
      "description": "[CSV Data Cleaning Pipeline] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "triggerPhrase": "A change to \"CSV Data Cleaning Pipeline\" needs to be designed first. Consider the common failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\" and the best practice \"Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for CSV Data Cleaning Pipeline. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. The output artifact is CSV parser / row validator / column type mapper / error report / cleaned output. Consider the failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the CSV Data Cleaning Pipeline feature\" — produce a step-by-step implementation sequence with CSV parser / row validator / column type mapper / error report / cleaned output as the target.",
        "\"Design CSV Data Cleaning Pipeline changes\" — document trade-offs, addressing Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:plan",
          "planning",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "database-migration-safety-plan",
      "name": "Database Migration Safety: Plan",
      "category": "Planning",
      "description": "[Database Migration Safety] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "triggerPhrase": "A change to \"Database Migration Safety\" needs to be designed first. Consider the common failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\" and the best practice \"Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Database Migration Safety. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. The output artifact is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Consider the failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Database Migration Safety feature\" — produce a step-by-step implementation sequence with batch migration / expand-contract pattern / zero-downtime migration / rollback plan as the target.",
        "\"Design Database Migration Safety changes\" — document trade-offs, addressing Running a long-running migration (e."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:database-migration-safety",
          "workflow:plan",
          "planning",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "data-warehouse-schema-plan",
      "name": "Data Warehouse Schema Design: Plan",
      "category": "Planning",
      "description": "[Data Warehouse Schema Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "triggerPhrase": "A change to \"Data Warehouse Schema Design\" needs to be designed first. Consider the common failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\" and the best practice \"Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Data Warehouse Schema Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. The output artifact is star schema / fact table / dimension table / ETL pipeline spec. Consider the failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Data Warehouse Schema Design feature\" — produce a step-by-step implementation sequence with star schema / fact table / dimension table / ETL pipeline spec as the target.",
        "\"Design Data Warehouse Schema Design changes\" — document trade-offs, addressing Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:plan",
          "planning",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "design-token-system-plan",
      "name": "Design Token Systems: Plan",
      "category": "Planning",
      "description": "[Design Token Systems] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "triggerPhrase": "A change to \"Design Token Systems\" needs to be designed first. Consider the common failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\" and the best practice \"Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Design Token Systems. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. The output artifact is token JSON / CSS custom properties / theme switcher / token documentation. Consider the failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Design Token Systems feature\" — produce a step-by-step implementation sequence with token JSON / CSS custom properties / theme switcher / token documentation as the target.",
        "\"Design Design Token Systems changes\" — document trade-offs, addressing Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:design-token-system",
          "workflow:plan",
          "planning",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-compose-networking-plan",
      "name": "Docker Compose Networking: Plan",
      "category": "Planning",
      "description": "[Docker Compose Networking] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "triggerPhrase": "A change to \"Docker Compose Networking\" needs to be designed first. Consider the common failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\" and the best practice \"All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Docker Compose Networking. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. The output artifact is docker-compose.yml / network config / healthcheck / depends_on condition. Consider the failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Docker Compose Networking feature\" — produce a step-by-step implementation sequence with docker-compose.yml / network config / healthcheck / depends_on condition as the target.",
        "\"Design Docker Compose Networking changes\" — document trade-offs, addressing Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-compose-networking",
          "workflow:plan",
          "planning",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-multistage-plan",
      "name": "Docker Multi-Stage Builds: Plan",
      "category": "Planning",
      "description": "[Docker Multi-Stage Builds] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "triggerPhrase": "A change to \"Docker Multi-Stage Builds\" needs to be designed first. Consider the common failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\" and the best practice \"Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Docker Multi-Stage Builds. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. The output artifact is multi-stage Dockerfile / .dockerignore / slim base image switch. Consider the failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Docker Multi-Stage Builds feature\" — produce a step-by-step implementation sequence with multi-stage Dockerfile / .dockerignore / slim base image switch as the target.",
        "\"Design Docker Multi-Stage Builds changes\" — document trade-offs, addressing Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-multistage",
          "workflow:plan",
          "planning",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "drizzle-schema-design-plan",
      "name": "Drizzle Schema Design: Plan",
      "category": "Planning",
      "description": "[Drizzle Schema Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "triggerPhrase": "A change to \"Drizzle Schema Design\" needs to be designed first. Consider the common failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\" and the best practice \"Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Drizzle Schema Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. The output artifact is schema.ts / relation map / migration SQL / Drizzle query builder. Consider the failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Drizzle Schema Design feature\" — produce a step-by-step implementation sequence with schema.ts / relation map / migration SQL / Drizzle query builder as the target.",
        "\"Design Drizzle Schema Design changes\" — document trade-offs, addressing Over-using relations() when simple foreign key columns with manual joins would be clearer and faster."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:plan",
          "planning",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "error-monitoring-setup-plan",
      "name": "Error Monitoring & Alerting Setup: Plan",
      "category": "Planning",
      "description": "[Error Monitoring & Alerting Setup] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "triggerPhrase": "A change to \"Error Monitoring & Alerting Setup\" needs to be designed first. Consider the common failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\" and the best practice \"Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Error Monitoring & Alerting Setup. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. The output artifact is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Consider the failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Error Monitoring & Alerting Setup feature\" — produce a step-by-step implementation sequence with Sentry project config / alert rule / error grouping / source map upload / performance monitoring as the target.",
        "\"Design Error Monitoring & Alerting Setup changes\" — document trade-offs, addressing Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:plan",
          "planning",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "fastapi-dependencies-plan",
      "name": "FastAPI Dependency Injection: Plan",
      "category": "Planning",
      "description": "[FastAPI Dependency Injection] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "triggerPhrase": "A change to \"FastAPI Dependency Injection\" needs to be designed first. Consider the common failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\" and the best practice \"Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for FastAPI Dependency Injection. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. The output artifact is dependency / lifespan handler / override for testing. Consider the failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific dependency / lifespan handler / override for testing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the FastAPI Dependency Injection feature\" — produce a step-by-step implementation sequence with dependency / lifespan handler / override for testing as the target.",
        "\"Design FastAPI Dependency Injection changes\" — document trade-offs, addressing Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:plan",
          "planning",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "feature-flags-plan",
      "name": "Feature Flags & Gradual Rollouts: Plan",
      "category": "Planning",
      "description": "[Feature Flags & Gradual Rollouts] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "triggerPhrase": "A change to \"Feature Flags & Gradual Rollouts\" needs to be designed first. Consider the common failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\" and the best practice \"Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Feature Flags & Gradual Rollouts. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. The output artifact is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Consider the failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Feature Flags & Gradual Rollouts feature\" — produce a step-by-step implementation sequence with flag provider config / gradual rollout target / flag cleanup plan / A/B test flag as the target.",
        "\"Design Feature Flags & Gradual Rollouts changes\" — document trade-offs, addressing Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:feature-flags",
          "workflow:plan",
          "planning",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "git-conflict-resolution-plan",
      "name": "Git Conflict Resolution: Plan",
      "category": "Planning",
      "description": "[Git Conflict Resolution] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "triggerPhrase": "A change to \"Git Conflict Resolution\" needs to be designed first. Consider the common failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\" and the best practice \"For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Git Conflict Resolution. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. The output artifact is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Consider the failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Git Conflict Resolution feature\" — produce a step-by-step implementation sequence with conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message as the target.",
        "\"Design Git Conflict Resolution changes\" — document trade-offs, addressing Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:plan",
          "planning",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "github-actions-pipeline-plan",
      "name": "GitHub Actions Pipeline Optimisation: Plan",
      "category": "Planning",
      "description": "[GitHub Actions Pipeline Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "triggerPhrase": "A change to \"GitHub Actions Pipeline Optimisation\" needs to be designed first. Consider the common failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\" and the best practice \"Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for GitHub Actions Pipeline Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. The output artifact is workflow YAML / cache config / matrix build / conditional job execution. Consider the failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the GitHub Actions Pipeline Optimisation feature\" — produce a step-by-step implementation sequence with workflow YAML / cache config / matrix build / conditional job execution as the target.",
        "\"Design GitHub Actions Pipeline Optimisation changes\" — document trade-offs, addressing Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:plan",
          "planning",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "graphql-n-plus-one-plan",
      "name": "GraphQL N+1 Query Prevention: Plan",
      "category": "Planning",
      "description": "[GraphQL N+1 Query Prevention] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "triggerPhrase": "A change to \"GraphQL N+1 Query Prevention\" needs to be designed first. Consider the common failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\" and the best practice \"Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for GraphQL N+1 Query Prevention. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. The output artifact is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Consider the failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the GraphQL N+1 Query Prevention feature\" — produce a step-by-step implementation sequence with DataLoader instance / batch load function / resolver refactor / query complexity analysis as the target.",
        "\"Design GraphQL N+1 Query Prevention changes\" — document trade-offs, addressing A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:plan",
          "planning",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "jest-test-optimization-plan",
      "name": "Jest Test Optimisation: Plan",
      "category": "Planning",
      "description": "[Jest Test Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "triggerPhrase": "A change to \"Jest Test Optimisation\" needs to be designed first. Consider the common failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\" and the best practice \"Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Jest Test Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. The output artifact is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Consider the failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Jest Test Optimisation feature\" — produce a step-by-step implementation sequence with jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking as the target.",
        "\"Design Jest Test Optimisation changes\" — document trade-offs, addressing Running the entire test suite on every change, taking minutes even for small incremental code changes."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:jest-test-optimization",
          "workflow:plan",
          "planning",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "json-schema-validation-plan",
      "name": "JSON Schema Validation: Plan",
      "category": "Planning",
      "description": "[JSON Schema Validation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "triggerPhrase": "A change to \"JSON Schema Validation\" needs to be designed first. Consider the common failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\" and the best practice \"Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for JSON Schema Validation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. The output artifact is JSON Schema / validator middleware / type guard / error message / response parser. Consider the failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the JSON Schema Validation feature\" — produce a step-by-step implementation sequence with JSON Schema / validator middleware / type guard / error message / response parser as the target.",
        "\"Design JSON Schema Validation changes\" — document trade-offs, addressing Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:json-schema-validation",
          "workflow:plan",
          "planning",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-hpa-plan",
      "name": "Kubernetes Horizontal Pod Autoscaling: Plan",
      "category": "Planning",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "triggerPhrase": "A change to \"Kubernetes Horizontal Pod Autoscaling\" needs to be designed first. Consider the common failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\" and the best practice \"Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Kubernetes Horizontal Pod Autoscaling. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. The output artifact is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Consider the failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Kubernetes Horizontal Pod Autoscaling feature\" — produce a step-by-step implementation sequence with HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config as the target.",
        "\"Design Kubernetes Horizontal Pod Autoscaling changes\" — document trade-offs, addressing HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:plan",
          "planning",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-pod-lifecycle-plan",
      "name": "Kubernetes Pod Lifecycle: Plan",
      "category": "Planning",
      "description": "[Kubernetes Pod Lifecycle] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "triggerPhrase": "A change to \"Kubernetes Pod Lifecycle\" needs to be designed first. Consider the common failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\" and the best practice \"Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Kubernetes Pod Lifecycle. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. The output artifact is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Consider the failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Kubernetes Pod Lifecycle feature\" — produce a step-by-step implementation sequence with deployment.yaml / startup probe / readiness probe / liveness probe / init container as the target.",
        "\"Design Kubernetes Pod Lifecycle changes\" — document trade-offs, addressing Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:plan",
          "planning",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "context-window-budget-plan",
      "name": "LLM Context Window Budget Management: Plan",
      "category": "Planning",
      "description": "[LLM Context Window Budget Management] Design a change with explicit assumptions, success criteria, and rollback instructions Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "triggerPhrase": "A change to \"LLM Context Window Budget Management\" needs to be designed first. Consider the common failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\" and the best practice \"Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for LLM Context Window Budget Management. Design a change with explicit assumptions, success criteria, and rollback instructions. Reference the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. The output artifact is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Consider the failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "json",
          "name": "json",
          "description": "JSON output"
        },
        {
          "kind": "checklist",
          "name": "chk",
          "description": "CHK output"
        }
      ],
      "examples": [
        "\"Plan the LLM Context Window Budget Management feature\" — produce a step-by-step implementation sequence with trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard as the target.",
        "\"Design LLM Context Window Budget Management changes\" — document trade-offs, addressing Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:context-window-budget",
          "workflow:plan",
          "planning",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "mcp-tool-design-plan",
      "name": "MCP Tool Design & Best Practices: Plan",
      "category": "Planning",
      "description": "[MCP Tool Design & Best Practices] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "triggerPhrase": "A change to \"MCP Tool Design & Best Practices\" needs to be designed first. Consider the common failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\" and the best practice \"Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for MCP Tool Design & Best Practices. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. The output artifact is MCP tool descriptor / resource definition / prompt template / server metadata. Consider the failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the MCP Tool Design & Best Practices feature\" — produce a step-by-step implementation sequence with MCP tool descriptor / resource definition / prompt template / server metadata as the target.",
        "\"Design MCP Tool Design & Best Practices changes\" — document trade-offs, addressing Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:mcp-tool-design",
          "workflow:plan",
          "planning",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "message-queues-plan",
      "name": "Message Queues & Background Jobs: Plan",
      "category": "Planning",
      "description": "[Message Queues & Background Jobs] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "triggerPhrase": "A change to \"Message Queues & Background Jobs\" needs to be designed first. Consider the common failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\" and the best practice \"Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Message Queues & Background Jobs. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. The output artifact is queue producer / worker / dead-letter handler / retry policy. Consider the failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Message Queues & Background Jobs feature\" — produce a step-by-step implementation sequence with queue producer / worker / dead-letter handler / retry policy as the target.",
        "\"Design Message Queues & Background Jobs changes\" — document trade-offs, addressing Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:message-queues",
          "workflow:plan",
          "planning",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "multi-tenant-isolation-plan",
      "name": "Multi-Tenant Data Isolation: Plan",
      "category": "Planning",
      "description": "[Multi-Tenant Data Isolation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "triggerPhrase": "A change to \"Multi-Tenant Data Isolation\" needs to be designed first. Consider the common failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\" and the best practice \"Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Multi-Tenant Data Isolation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. The output artifact is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Consider the failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Multi-Tenant Data Isolation feature\" — produce a step-by-step implementation sequence with RLS policy / tenant context middleware / session variable injection / tenant-aware query builder as the target.",
        "\"Design Multi-Tenant Data Isolation changes\" — document trade-offs, addressing Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:plan",
          "planning",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-api-routes-plan",
      "name": "Next.js API Routes & Route Handlers: Plan",
      "category": "Planning",
      "description": "[Next.js API Routes & Route Handlers] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "triggerPhrase": "A change to \"Next.js API Routes & Route Handlers\" needs to be designed first. Consider the common failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\" and the best practice \"All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Next.js API Routes & Route Handlers. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. The output artifact is route.ts handler / server action / API client wrapper / error boundary. Consider the failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Next.js API Routes & Route Handlers feature\" — produce a step-by-step implementation sequence with route.ts handler / server action / API client wrapper / error boundary as the target.",
        "\"Design Next.js API Routes & Route Handlers changes\" — document trade-offs, addressing Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:plan",
          "planning",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-data-fetching-plan",
      "name": "Next.js Data Fetching Patterns: Plan",
      "category": "Planning",
      "description": "[Next.js Data Fetching Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "triggerPhrase": "A change to \"Next.js Data Fetching Patterns\" needs to be designed first. Consider the common failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\" and the best practice \"Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Next.js Data Fetching Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. The output artifact is server fetch / React cache wrapper / streaming suspense boundary. Consider the failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Next.js Data Fetching Patterns feature\" — produce a step-by-step implementation sequence with server fetch / React cache wrapper / streaming suspense boundary as the target.",
        "\"Design Next.js Data Fetching Patterns changes\" — document trade-offs, addressing Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:plan",
          "planning",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-middleware-plan",
      "name": "Next.js Middleware & Edge Runtime: Plan",
      "category": "Planning",
      "description": "[Next.js Middleware & Edge Runtime] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "triggerPhrase": "A change to \"Next.js Middleware & Edge Runtime\" needs to be designed first. Consider the common failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\" and the best practice \"Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Next.js Middleware & Edge Runtime. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. The output artifact is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Consider the failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Next.js Middleware & Edge Runtime feature\" — produce a step-by-step implementation sequence with middleware.ts / rewrite rule / cookie-based redirect / geolocation routing as the target.",
        "\"Design Next.js Middleware & Edge Runtime changes\" — document trade-offs, addressing Using Node."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-middleware",
          "workflow:plan",
          "planning",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-error-handling-plan",
      "name": "Node.js Error Handling & Resilience: Plan",
      "category": "Planning",
      "description": "[Node.js Error Handling & Resilience] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "triggerPhrase": "A change to \"Node.js Error Handling & Resilience\" needs to be designed first. Consider the common failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\" and the best practice \"Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Node.js Error Handling & Resilience. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. The output artifact is global error handler / async wrapper / structured error response / retry logic. Consider the failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Node.js Error Handling & Resilience feature\" — produce a step-by-step implementation sequence with global error handler / async wrapper / structured error response / retry logic as the target.",
        "\"Design Node.js Error Handling & Resilience changes\" — document trade-offs, addressing Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-error-handling",
          "workflow:plan",
          "planning",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-streams-plan",
      "name": "Node.js Streams & Backpressure: Plan",
      "category": "Planning",
      "description": "[Node.js Streams & Backpressure] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "triggerPhrase": "A change to \"Node.js Streams & Backpressure\" needs to be designed first. Consider the common failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\" and the best practice \"Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Node.js Streams & Backpressure. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. The output artifact is Readable/Writable stream / Transform / pipeline() refactor. Consider the failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Node.js Streams & Backpressure feature\" — produce a step-by-step implementation sequence with Readable/Writable stream / Transform / pipeline() refactor as the target.",
        "\"Design Node.js Streams & Backpressure changes\" — document trade-offs, addressing Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-streams",
          "workflow:plan",
          "planning",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "oauth-flows-plan",
      "name": "OAuth 2.0 Flows & Token Management: Plan",
      "category": "Planning",
      "description": "[OAuth 2.0 Flows & Token Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "triggerPhrase": "A change to \"OAuth 2.0 Flows & Token Management\" needs to be designed first. Consider the common failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\" and the best practice \"Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for OAuth 2.0 Flows & Token Management. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. The output artifact is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Consider the failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the OAuth 2.0 Flows & Token Management feature\" — produce a step-by-step implementation sequence with OAuth callback / token refresh / PKCE flow / httpOnly cookie handler as the target.",
        "\"Design OAuth 2.0 Flows & Token Management changes\" — document trade-offs, addressing Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:oauth-flows",
          "workflow:plan",
          "planning",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "openapi-spec-plan",
      "name": "OpenAPI Specification & Validation: Plan",
      "category": "Planning",
      "description": "[OpenAPI Specification & Validation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "triggerPhrase": "A change to \"OpenAPI Specification & Validation\" needs to be designed first. Consider the common failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\" and the best practice \"Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for OpenAPI Specification & Validation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. The output artifact is openapi.yaml / code-first generator / request/response validation middleware. Consider the failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the OpenAPI Specification & Validation feature\" — produce a step-by-step implementation sequence with openapi.yaml / code-first generator / request/response validation middleware as the target.",
        "\"Design OpenAPI Specification & Validation changes\" — document trade-offs, addressing Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:openapi-spec",
          "workflow:plan",
          "planning",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "playwright-selectors-plan",
      "name": "Playwright Selectors & Locators: Plan",
      "category": "Planning",
      "description": "[Playwright Selectors & Locators] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "triggerPhrase": "A change to \"Playwright Selectors & Locators\" needs to be designed first. Consider the common failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\" and the best practice \"Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Playwright Selectors & Locators. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. The output artifact is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Consider the failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Playwright Selectors & Locators feature\" — produce a step-by-step implementation sequence with locator refactor / test fixture / POM (Page Object Model) / custom fixture as the target.",
        "\"Design Playwright Selectors & Locators changes\" — document trade-offs, addressing Using fragile CSS selectors (nth-child, class names that change) that break on every UI update."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:playwright-selectors",
          "workflow:plan",
          "planning",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "prompt-injection-defense-plan",
      "name": "Prompt Injection Defense: Plan",
      "category": "Planning",
      "description": "[Prompt Injection Defense] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "triggerPhrase": "A change to \"Prompt Injection Defense\" needs to be designed first. Consider the common failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\" and the best practice \"Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Prompt Injection Defense. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. The output artifact is defensive system prompt / input sanitizer / instruction guardrail / output validator. Consider the failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Prompt Injection Defense feature\" — produce a step-by-step implementation sequence with defensive system prompt / input sanitizer / instruction guardrail / output validator as the target.",
        "\"Design Prompt Injection Defense changes\" — document trade-offs, addressing Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:plan",
          "planning",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-async-plan",
      "name": "Python Async/Await Patterns: Plan",
      "category": "Planning",
      "description": "[Python Async/Await Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "triggerPhrase": "A change to \"Python Async/Await Patterns\" needs to be designed first. Consider the common failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\" and the best practice \"Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Python Async/Await Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. The output artifact is async/await refactor / asyncio.gather / async context manager. Consider the failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Python Async/Await Patterns feature\" — produce a step-by-step implementation sequence with async/await refactor / asyncio.gather / async context manager as the target.",
        "\"Design Python Async/Await Patterns changes\" — document trade-offs, addressing Blocking the event loop by using synchronous requests or time."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-async",
          "workflow:plan",
          "planning",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-file-io-plan",
      "name": "Python File I/O & Encoding: Plan",
      "category": "Planning",
      "description": "[Python File I/O & Encoding] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "triggerPhrase": "A change to \"Python File I/O & Encoding\" needs to be designed first. Consider the common failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\" and the best practice \"Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Python File I/O & Encoding. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. The output artifact is pathlib refactor / encoding-safe file reader / batch file processor. Consider the failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Python File I/O & Encoding feature\" — produce a step-by-step implementation sequence with pathlib refactor / encoding-safe file reader / batch file processor as the target.",
        "\"Design Python File I/O & Encoding changes\" — document trade-offs, addressing Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-file-io",
          "workflow:plan",
          "planning",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rag-chunking-plan",
      "name": "RAG Chunking Strategies: Plan",
      "category": "Planning",
      "description": "[RAG Chunking Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "triggerPhrase": "A change to \"RAG Chunking Strategies\" needs to be designed first. Consider the common failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\" and the best practice \"Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for RAG Chunking Strategies. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. The output artifact is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Consider the failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the RAG Chunking Strategies feature\" — produce a step-by-step implementation sequence with semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment as the target.",
        "\"Design RAG Chunking Strategies changes\" — document trade-offs, addressing Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rag-chunking",
          "workflow:plan",
          "planning",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rate-limiting-proxy-plan",
      "name": "Rate Limiting & API Gateway Proxy: Plan",
      "category": "Planning",
      "description": "[Rate Limiting & API Gateway Proxy] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "triggerPhrase": "A change to \"Rate Limiting & API Gateway Proxy\" needs to be designed first. Consider the common failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\" and the best practice \"Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Rate Limiting & API Gateway Proxy. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. The output artifact is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Consider the failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Rate Limiting & API Gateway Proxy feature\" — produce a step-by-step implementation sequence with NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation as the target.",
        "\"Design Rate Limiting & API Gateway Proxy changes\" — document trade-offs, addressing Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:plan",
          "planning",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-server-components-plan",
      "name": "React Server Components: Plan",
      "category": "Planning",
      "description": "[React Server Components] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "triggerPhrase": "A change to \"React Server Components\" needs to be designed first. Consider the common failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\" and the best practice \"Keep data fetching and heavy logic in server components; pass results as props to client islands.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for React Server Components. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. The output artifact is server component / client boundary refactor / streaming fallback. Consider the failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the React Server Components feature\" — produce a step-by-step implementation sequence with server component / client boundary refactor / streaming fallback as the target.",
        "\"Design React Server Components changes\" — document trade-offs, addressing Accidentally making a server component a client component by using hooks or event handlers in the wrong file."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-server-components",
          "workflow:plan",
          "planning",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-state-plan",
      "name": "React State Management: Plan",
      "category": "Planning",
      "description": "[React State Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "triggerPhrase": "A change to \"React State Management\" needs to be designed first. Consider the common failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\" and the best practice \"Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for React State Management. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. The output artifact is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Consider the failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the React State Management feature\" — produce a step-by-step implementation sequence with useState / useReducer / useContext hook refactor, zustand or jotai store slice as the target.",
        "\"Design React State Management changes\" — document trade-offs, addressing Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-state",
          "workflow:plan",
          "planning",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "reasoning-architect",
      "name": "Reasoning Architect",
      "category": "Planning",
      "description": "Breaks complex, multi-step tasks into a structured plan with explicit assumptions, success criteria, and a minimax strategy: minimal effort for maximum verifiable impact. Every step includes a rollback path.",
      "triggerPhrase": "Call this when a task spans multiple systems, is vaguely defined, or carries risk of cascading failures.",
      "promptTemplate": "Restate the goal in one sentence. List all implicit assumptions. Define success criteria as concrete, testable outcomes. Decompose into smallest viable steps. For each step: expected output, boundary risk, verification command, and rollback instruction. Optimise for the shortest path to a working increment. If any step requires a decision, present options with trade-offs in a table.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "'Add a payment system' → produce a plan covering Stripe integration, webhook handling, idempotency, and failure recovery.",
        "'Migrate database' → schema diff, data migration script, rollback query, and read-only mode during cutover."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "planning",
          "decomposition",
          "risk-management"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "redis-caching-plan",
      "name": "Redis Caching Strategies: Plan",
      "category": "Planning",
      "description": "[Redis Caching Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "triggerPhrase": "A change to \"Redis Caching Strategies\" needs to be designed first. Consider the common failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\" and the best practice \"Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Redis Caching Strategies. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. The output artifact is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Consider the failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Redis Caching Strategies feature\" — produce a step-by-step implementation sequence with cache wrapper / mutex lock / stale-while-revalidate / TTL policy as the target.",
        "\"Design Redis Caching Strategies changes\" — document trade-offs, addressing Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:redis-caching",
          "workflow:plan",
          "planning",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rest-pagination-plan",
      "name": "REST Pagination Design: Plan",
      "category": "Planning",
      "description": "[REST Pagination Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "triggerPhrase": "A change to \"REST Pagination Design\" needs to be designed first. Consider the common failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\" and the best practice \"Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for REST Pagination Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. The output artifact is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Consider the failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the REST Pagination Design feature\" — produce a step-by-step implementation sequence with cursor pagination / offset pagination fallback / total count optimisation / response envelope as the target.",
        "\"Design REST Pagination Design changes\" — document trade-offs, addressing Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rest-pagination",
          "workflow:plan",
          "planning",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "secrets-rotation-plan",
      "name": "Secrets Rotation Policy: Plan",
      "category": "Planning",
      "description": "[Secrets Rotation Policy] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "triggerPhrase": "A change to \"Secrets Rotation Policy\" needs to be designed first. Consider the common failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\" and the best practice \"Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Secrets Rotation Policy. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. The output artifact is rotation script / vault integration / lease management / incident response plan. Consider the failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Secrets Rotation Policy feature\" — produce a step-by-step implementation sequence with rotation script / vault integration / lease management / incident response plan as the target.",
        "\"Design Secrets Rotation Policy changes\" — document trade-offs, addressing Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:secrets-rotation",
          "workflow:plan",
          "planning",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "shell-script-robustness-plan",
      "name": "Shell Script Robustness & Safety: Plan",
      "category": "Planning",
      "description": "[Shell Script Robustness & Safety] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "triggerPhrase": "A change to \"Shell Script Robustness & Safety\" needs to be designed first. Consider the common failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\" and the best practice \"Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Shell Script Robustness & Safety. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. The output artifact is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Consider the failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Shell Script Robustness & Safety feature\" — produce a step-by-step implementation sequence with set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function as the target.",
        "\"Design Shell Script Robustness & Safety changes\" — document trade-offs, addressing Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:shell-script-robustness",
          "workflow:plan",
          "planning",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "sql-query-optimization-plan",
      "name": "SQL Query Optimisation: Plan",
      "category": "Planning",
      "description": "[SQL Query Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "triggerPhrase": "A change to \"SQL Query Optimisation\" needs to be designed first. Consider the common failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\" and the best practice \"Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for SQL Query Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. The output artifact is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Consider the failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the SQL Query Optimisation feature\" — produce a step-by-step implementation sequence with indexed query / composite index / EXPLAIN ANALYSE plan / partial index as the target.",
        "\"Design SQL Query Optimisation changes\" — document trade-offs, addressing Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:sql-query-optimization",
          "workflow:plan",
          "planning",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stealth-web-research-plan",
      "name": "Stealth Web Research & Harvesting: Plan",
      "category": "Planning",
      "description": "[Stealth Web Research & Harvesting] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "triggerPhrase": "A change to \"Stealth Web Research & Harvesting\" needs to be designed first. Consider the common failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\" and the best practice \"Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Stealth Web Research & Harvesting. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. The output artifact is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Consider the failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Stealth Web Research & Harvesting feature\" — produce a step-by-step implementation sequence with clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages as the target.",
        "\"Design Stealth Web Research & Harvesting changes\" — document trade-offs, addressing Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stealth-web-research",
          "workflow:plan",
          "planning",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stripe-webhook-idempotency-plan",
      "name": "Stripe Webhook Idempotency: Plan",
      "category": "Planning",
      "description": "[Stripe Webhook Idempotency] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "triggerPhrase": "A change to \"Stripe Webhook Idempotency\" needs to be designed first. Consider the common failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\" and the best practice \"Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Stripe Webhook Idempotency. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. The output artifact is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Consider the failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Stripe Webhook Idempotency feature\" — produce a step-by-step implementation sequence with Webhook handler / idempotency key check / event deduplication / failed payment recovery as the target.",
        "\"Design Stripe Webhook Idempotency changes\" — document trade-offs, addressing Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:plan",
          "planning",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "supabase-rls-plan",
      "name": "Supabase Row-Level Security: Plan",
      "category": "Planning",
      "description": "[Supabase Row-Level Security] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "triggerPhrase": "A change to \"Supabase Row-Level Security\" needs to be designed first. Consider the common failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\" and the best practice \"Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Supabase Row-Level Security. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. The output artifact is RLS policy / policy test / security definer function / admin bypass. Consider the failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Supabase Row-Level Security feature\" — produce a step-by-step implementation sequence with RLS policy / policy test / security definer function / admin bypass as the target.",
        "\"Design Supabase Row-Level Security changes\" — document trade-offs, addressing RLS policies that are too permissive (using 'true' instead of 'auth."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:supabase-rls",
          "workflow:plan",
          "planning",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "terraform-state-plan",
      "name": "Terraform State Management: Plan",
      "category": "Planning",
      "description": "[Terraform State Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "triggerPhrase": "A change to \"Terraform State Management\" needs to be designed first. Consider the common failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\" and the best practice \"Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Terraform State Management. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. The output artifact is backend config / state migration plan / state locking config / remote state datasource. Consider the failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Terraform State Management feature\" — produce a step-by-step implementation sequence with backend config / state migration plan / state locking config / remote state datasource as the target.",
        "\"Design Terraform State Management changes\" — document trade-offs, addressing Losing the ."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:terraform-state",
          "workflow:plan",
          "planning",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "typescript-generics-plan",
      "name": "TypeScript Generics & Advanced Types: Plan",
      "category": "Planning",
      "description": "[TypeScript Generics & Advanced Types] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "triggerPhrase": "A change to \"TypeScript Generics & Advanced Types\" needs to be designed first. Consider the common failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\" and the best practice \"Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for TypeScript Generics & Advanced Types. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. The output artifact is generic type / conditional type / mapped type / branded type. Consider the failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice). and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the TypeScript Generics & Advanced Types feature\" — produce a step-by-step implementation sequence with generic type / conditional type / mapped type / branded type as the target.",
        "\"Design TypeScript Generics & Advanced Types changes\" — document trade-offs, addressing Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:typescript-generics",
          "workflow:plan",
          "planning",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "user-onboarding-flow-plan",
      "name": "User Onboarding Flow Design: Plan",
      "category": "Planning",
      "description": "[User Onboarding Flow Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "triggerPhrase": "A change to \"User Onboarding Flow Design\" needs to be designed first. Consider the common failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\" and the best practice \"Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for User Onboarding Flow Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. The output artifact is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Consider the failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the User Onboarding Flow Design feature\" — produce a step-by-step implementation sequence with onboarding wizard / feature checklist / in-app guide / first-run experience spec as the target.",
        "\"Design User Onboarding Flow Design changes\" — document trade-offs, addressing Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:plan",
          "planning",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "vercel-env-vars-plan",
      "name": "Vercel Environment Variables: Plan",
      "category": "Planning",
      "description": "[Vercel Environment Variables] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "triggerPhrase": "A change to \"Vercel Environment Variables\" needs to be designed first. Consider the common failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\" and the best practice \"Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Vercel Environment Variables. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. The output artifact is vercel.json env group / preview env config / Edge Config / KV store. Consider the failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Vercel Environment Variables feature\" — produce a step-by-step implementation sequence with vercel.json env group / preview env config / Edge Config / KV store as the target.",
        "\"Design Vercel Environment Variables changes\" — document trade-offs, addressing Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:vercel-env-vars",
          "workflow:plan",
          "planning",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-scraping-ethics-plan",
      "name": "Web Scraping Ethics & Compliance: Plan",
      "category": "Planning",
      "description": "[Web Scraping Ethics & Compliance] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "triggerPhrase": "A change to \"Web Scraping Ethics & Compliance\" needs to be designed first. Consider the common failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\" and the best practice \"Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Web Scraping Ethics & Compliance. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. The output artifact is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Consider the failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Web Scraping Ethics & Compliance feature\" — produce a step-by-step implementation sequence with robots.txt check / polite scraper / rate-limited crawler / cached scraper as the target.",
        "\"Design Web Scraping Ethics & Compliance changes\" — document trade-offs, addressing Scraping a website that explicitly prohibits it in robots."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:plan",
          "planning",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "websocket-reconnection-plan",
      "name": "WebSocket Reconnection Strategies: Plan",
      "category": "Planning",
      "description": "[WebSocket Reconnection Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "triggerPhrase": "A change to \"WebSocket Reconnection Strategies\" needs to be designed first. Consider the common failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\" and the best practice \"Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for WebSocket Reconnection Strategies. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. The output artifact is WebSocket client / reconnection logic / heartbeat / connection status component. Consider the failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state. and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the WebSocket Reconnection Strategies feature\" — produce a step-by-step implementation sequence with WebSocket client / reconnection logic / heartbeat / connection status component as the target.",
        "\"Design WebSocket Reconnection Strategies changes\" — document trade-offs, addressing Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:websocket-reconnection",
          "workflow:plan",
          "planning",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-vitals-optimization-plan",
      "name": "Web Vitals Optimisation (LCP/CLS/INP): Plan",
      "category": "Planning",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "triggerPhrase": "A change to \"Web Vitals Optimisation (LCP/CLS/INP)\" needs to be designed first. Consider the common failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\" and the best practice \"Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.\". Produce a plan before writing any code.",
      "promptTemplate": "You are designing a plan for Web Vitals Optimisation (LCP/CLS/INP). Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. The output artifact is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Consider the failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions). and propose mitigations.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Plan the Web Vitals Optimisation (LCP/CLS/INP) feature\" — produce a step-by-step implementation sequence with image optimisation / font display swap / critical CSS / lazy load / bundle analysis as the target.",
        "\"Design Web Vitals Optimisation (LCP/CLS/INP) changes\" — document trade-offs, addressing Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:plan",
          "planning",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "incident-debugger",
      "name": "Incident Debugger",
      "category": "Quality",
      "description": "Systematically isolates the root cause of a failure by separating symptoms from causes, generating minimal hypotheses, and testing them one at a time with minimal code changes.",
      "triggerPhrase": "Call this when a build fails, a test fails, an API returns an unexpected status, or a runtime error occurs.",
      "promptTemplate": "Read the error output. Identify the first concrete error line (file, line number, and error code). Separate the symptom (what the user sees) from the root cause (the underlying code or configuration issue). Generate up to three minimal-fix hypotheses, ordered by likelihood. For each hypothesis, write a single verification command (type-check a specific file, curl a single endpoint, run one test). Execute hypotheses one at a time. After finding the fix, run the full verification-runner sequence.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "log",
          "required": true,
          "description": "Error log, stack trace, or failure description."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "Build error: 'Module not found: ./Button' → hypothesis 1: file renamed, verify with 'ls src/components/Button*'. Hypothesis 2: import path case mismatch, verify with 'grep -r \"Button\" src/'.",
        "API returns 500: check application logs → hypothesis 1: database connection pool exhausted, verify with 'db pool status'. Hypothesis 2: unhandled promise rejection, verify with 'node --trace-warnings'."
      ],
      "metadata": {
        "risk": "medium",
        "tags": [
          "debugging",
          "root-cause",
          "triage"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "verification-runner",
      "name": "Verification Runner",
      "category": "Quality",
      "description": "Defines and executes a standard post-change verification sequence: type-check → lint → unit tests → build → smoke tests. Adjusts rigour based on change risk level.",
      "triggerPhrase": "Call this after completing any code change to confirm nothing is broken.",
      "promptTemplate": "Assess the change risk: low (comments, config, docs), medium (new function, refactor within a file), high (schema change, dependency upgrade, public API change). Based on risk, select verification steps from: (1) type-check, (2) lint, (3) affected unit tests, (4) full test suite, (5) build, (6) smoke test (curl endpoints, load page). For each step provide the exact command, expected outcome, and where to look on failure. Execute the sequence and report pass/fail per step.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        }
      ],
      "outputs": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "Low-risk (documentation update): run 'npm run lint' and 'npm run build'. Medium-risk (new API endpoint): run 'npm run typecheck', test new endpoint with curl, run 'npm run build'. High-risk (schema migration): run all steps plus 'drizzle-kit push' and a rollback test."
      ],
      "metadata": {
        "risk": "low",
        "tags": [
          "verification",
          "quality",
          "ci-simulation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a-b-testing-framework-harden",
      "name": "A/B Testing Framework: Harden",
      "category": "Security",
      "description": "[A/B Testing Framework] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "triggerPhrase": "Audit and harden \"A/B Testing Framework\". The common failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\" may be present. Follow the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening A/B Testing Framework. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Apply the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden A/B Testing Framework\" — audit for Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise and apply the best practice fix.",
        "\"Secure A/B Testing Framework setup\" — review experiment spec / variant assignment / metric definition / statistical analysis script and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:harden",
          "security",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "a11y-aria-patterns-harden",
      "name": "Accessibility ARIA Patterns: Harden",
      "category": "Security",
      "description": "[Accessibility ARIA Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "triggerPhrase": "Audit and harden \"Accessibility ARIA Patterns\". The common failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\" may be present. Follow the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Accessibility ARIA Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Apply the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Accessibility ARIA Patterns\" — audit for Adding ARIA attributes that conflict with native HTML semantics (e and apply the best practice fix.",
        "\"Secure Accessibility ARIA Patterns setup\" — review ARIA attribute refactor / keyboard navigation / focus management / screen reader test script and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:harden",
          "security",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "agent-tool-binding-harden",
      "name": "Agent Tool Binding & Dispatch: Harden",
      "category": "Security",
      "description": "[Agent Tool Binding & Dispatch] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "triggerPhrase": "Audit and harden \"Agent Tool Binding & Dispatch\". The common failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\" may be present. Follow the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Agent Tool Binding & Dispatch. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Apply the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Agent Tool Binding & Dispatch\" — audit for Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly and apply the best practice fix.",
        "\"Secure Agent Tool Binding & Dispatch setup\" — review router tool / domain group / dynamic tool injection / tool usage statistics and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:agent-tool-binding",
          "workflow:harden",
          "security",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "analytics-metric-definition-harden",
      "name": "Analytics Metric Definitions: Harden",
      "category": "Security",
      "description": "[Analytics Metric Definitions] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "triggerPhrase": "Audit and harden \"Analytics Metric Definitions\". The common failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\" may be present. Follow the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Analytics Metric Definitions. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Apply the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Analytics Metric Definitions\" — audit for Different teams computing the same metric (e and apply the best practice fix.",
        "\"Secure Analytics Metric Definitions setup\" — review metric definition / dbt model / SQL logic / dashboard tile / documentation and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:harden",
          "security",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "adr-documentation-harden",
      "name": "Architecture Decision Records: Harden",
      "category": "Security",
      "description": "[Architecture Decision Records] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "triggerPhrase": "Audit and harden \"Architecture Decision Records\". The common failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\" may be present. Follow the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Architecture Decision Records. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Apply the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific ADR document / decision log / template / review workflow this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Architecture Decision Records\" — audit for Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done and apply the best practice fix.",
        "\"Secure Architecture Decision Records setup\" — review ADR document / decision log / template / review workflow and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:adr-documentation",
          "workflow:harden",
          "security",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "aws-lambda-cold-start-harden",
      "name": "AWS Lambda Cold Starts: Harden",
      "category": "Security",
      "description": "[AWS Lambda Cold Starts] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "triggerPhrase": "Audit and harden \"AWS Lambda Cold Starts\". The common failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\" may be present. Follow the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening AWS Lambda Cold Starts. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Apply the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden AWS Lambda Cold Starts\" — audit for Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler and apply the best practice fix.",
        "\"Secure AWS Lambda Cold Starts setup\" — review handler refactor / SnapStart config / Provisioned Concurrency / warmer function and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:harden",
          "security",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "azure-bicep-harden",
      "name": "Azure Bicep Infrastructure: Harden",
      "category": "Security",
      "description": "[Azure Bicep Infrastructure] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "triggerPhrase": "Audit and harden \"Azure Bicep Infrastructure\". The common failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\" may be present. Follow the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Azure Bicep Infrastructure. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Apply the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific main.bicep / module / parameter file / azd template this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Azure Bicep Infrastructure\" — audit for Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce and apply the best practice fix.",
        "\"Secure Azure Bicep Infrastructure setup\" — review main.bicep / module / parameter file / azd template and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:azure-bicep",
          "workflow:harden",
          "security",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "browser-devtools-harden",
      "name": "Browser DevTools & Debugging: Harden",
      "category": "Security",
      "description": "[Browser DevTools & Debugging] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "triggerPhrase": "Audit and harden \"Browser DevTools & Debugging\". The common failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\" may be present. Follow the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Browser DevTools & Debugging. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Apply the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Browser DevTools & Debugging\" — audit for Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically and apply the best practice fix.",
        "\"Secure Browser DevTools & Debugging setup\" — review debugging workflow / breakpoint guide / performance recording / memory snapshot and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:browser-devtools",
          "workflow:harden",
          "security",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cli-tool-design-harden",
      "name": "CLI Tool Design Patterns: Harden",
      "category": "Security",
      "description": "[CLI Tool Design Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "triggerPhrase": "Audit and harden \"CLI Tool Design Patterns\". The common failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\" may be present. Follow the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening CLI Tool Design Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Apply the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden CLI Tool Design Patterns\" — audit for Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with and apply the best practice fix.",
        "\"Secure CLI Tool Design Patterns setup\" — review CLI scaffolding / argument parser / exit code handler / --json output mode and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:cli-tool-design",
          "workflow:harden",
          "security",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cloud-cost-optimization-harden",
      "name": "Cloud Cost Optimisation: Harden",
      "category": "Security",
      "description": "[Cloud Cost Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "triggerPhrase": "Audit and harden \"Cloud Cost Optimisation\". The common failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\" may be present. Follow the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Cloud Cost Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Apply the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Cloud Cost Optimisation\" — audit for Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours and apply the best practice fix.",
        "\"Secure Cloud Cost Optimisation setup\" — review right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:harden",
          "security",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "code-review-checklist-harden",
      "name": "Code Review Checklist: Harden",
      "category": "Security",
      "description": "[Code Review Checklist] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "triggerPhrase": "Audit and harden \"Code Review Checklist\". The common failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\" may be present. Follow the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Code Review Checklist. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Apply the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Code Review Checklist\" — audit for Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions and apply the best practice fix.",
        "\"Secure Code Review Checklist setup\" — review review checklist / automated review comment / risk classification / diff summary and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:code-review-checklist",
          "workflow:harden",
          "security",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "convex-functions-harden",
      "name": "Convex Functions & Mutations: Harden",
      "category": "Security",
      "description": "[Convex Functions & Mutations] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "triggerPhrase": "Audit and harden \"Convex Functions & Mutations\". The common failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\" may be present. Follow the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Convex Functions & Mutations. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Apply the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific mutation / query / action / component / scheduler job this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Convex Functions & Mutations\" — audit for Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients and apply the best practice fix.",
        "\"Secure Convex Functions & Mutations setup\" — review mutation / query / action / component / scheduler job and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:convex-functions",
          "workflow:harden",
          "security",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "cron-job-reliability-harden",
      "name": "Cron Job & Scheduled Task Reliability: Harden",
      "category": "Security",
      "description": "[Cron Job & Scheduled Task Reliability] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "triggerPhrase": "Audit and harden \"Cron Job & Scheduled Task Reliability\". The common failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\" may be present. Follow the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Cron Job & Scheduled Task Reliability. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Apply the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Cron Job & Scheduled Task Reliability\" — audit for Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time and apply the best practice fix.",
        "\"Secure Cron Job & Scheduled Task Reliability setup\" — review crontab entry / log rotation / idempotency guard / failure alert integration and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:cron-job-reliability",
          "workflow:harden",
          "security",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "css-layout-harden",
      "name": "CSS Layout & Responsiveness: Harden",
      "category": "Security",
      "description": "[CSS Layout & Responsiveness] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "triggerPhrase": "Audit and harden \"CSS Layout & Responsiveness\". The common failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\" may be present. Follow the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening CSS Layout & Responsiveness. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Apply the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden CSS Layout & Responsiveness\" — audit for Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable and apply the best practice fix.",
        "\"Secure CSS Layout & Responsiveness setup\" — review CSS layout refactor / responsive grid / container query implementation and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:css-layout",
          "workflow:harden",
          "security",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "csv-data-cleaning-harden",
      "name": "CSV Data Cleaning Pipeline: Harden",
      "category": "Security",
      "description": "[CSV Data Cleaning Pipeline] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "triggerPhrase": "Audit and harden \"CSV Data Cleaning Pipeline\". The common failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\" may be present. Follow the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening CSV Data Cleaning Pipeline. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Apply the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden CSV Data Cleaning Pipeline\" — audit for Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines and apply the best practice fix.",
        "\"Secure CSV Data Cleaning Pipeline setup\" — review CSV parser / row validator / column type mapper / error report / cleaned output and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:harden",
          "security",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "database-migration-safety-harden",
      "name": "Database Migration Safety: Harden",
      "category": "Security",
      "description": "[Database Migration Safety] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "triggerPhrase": "Audit and harden \"Database Migration Safety\". The common failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\" may be present. Follow the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Database Migration Safety. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Apply the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Database Migration Safety\" — audit for Running a long-running migration (e and apply the best practice fix.",
        "\"Secure Database Migration Safety setup\" — review batch migration / expand-contract pattern / zero-downtime migration / rollback plan and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:database-migration-safety",
          "workflow:harden",
          "security",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "data-warehouse-schema-harden",
      "name": "Data Warehouse Schema Design: Harden",
      "category": "Security",
      "description": "[Data Warehouse Schema Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "triggerPhrase": "Audit and harden \"Data Warehouse Schema Design\". The common failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\" may be present. Follow the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Data Warehouse Schema Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Apply the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Data Warehouse Schema Design\" — audit for Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries and apply the best practice fix.",
        "\"Secure Data Warehouse Schema Design setup\" — review star schema / fact table / dimension table / ETL pipeline spec and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:harden",
          "security",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "design-token-system-harden",
      "name": "Design Token Systems: Harden",
      "category": "Security",
      "description": "[Design Token Systems] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "triggerPhrase": "Audit and harden \"Design Token Systems\". The common failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\" may be present. Follow the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Design Token Systems. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Apply the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Design Token Systems\" — audit for Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file and apply the best practice fix.",
        "\"Secure Design Token Systems setup\" — review token JSON / CSS custom properties / theme switcher / token documentation and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:design-token-system",
          "workflow:harden",
          "security",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-compose-networking-harden",
      "name": "Docker Compose Networking: Harden",
      "category": "Security",
      "description": "[Docker Compose Networking] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "triggerPhrase": "Audit and harden \"Docker Compose Networking\". The common failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\" may be present. Follow the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Docker Compose Networking. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Apply the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Docker Compose Networking\" — audit for Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name and apply the best practice fix.",
        "\"Secure Docker Compose Networking setup\" — review docker-compose.yml / network config / healthcheck / depends_on condition and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:docker-compose-networking",
          "workflow:harden",
          "security",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "docker-multistage-harden",
      "name": "Docker Multi-Stage Builds: Harden",
      "category": "Security",
      "description": "[Docker Multi-Stage Builds] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "triggerPhrase": "Audit and harden \"Docker Multi-Stage Builds\". The common failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\" may be present. Follow the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Docker Multi-Stage Builds. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Apply the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Docker Multi-Stage Builds\" — audit for Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure and apply the best practice fix.",
        "\"Secure Docker Multi-Stage Builds setup\" — review multi-stage Dockerfile / .dockerignore / slim base image switch and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:docker-multistage",
          "workflow:harden",
          "security",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "drizzle-schema-design-harden",
      "name": "Drizzle Schema Design: Harden",
      "category": "Security",
      "description": "[Drizzle Schema Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "triggerPhrase": "Audit and harden \"Drizzle Schema Design\". The common failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\" may be present. Follow the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Drizzle Schema Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Apply the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Drizzle Schema Design\" — audit for Over-using relations() when simple foreign key columns with manual joins would be clearer and faster and apply the best practice fix.",
        "\"Secure Drizzle Schema Design setup\" — review schema.ts / relation map / migration SQL / Drizzle query builder and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:harden",
          "security",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "error-monitoring-setup-harden",
      "name": "Error Monitoring & Alerting Setup: Harden",
      "category": "Security",
      "description": "[Error Monitoring & Alerting Setup] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "triggerPhrase": "Audit and harden \"Error Monitoring & Alerting Setup\". The common failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\" may be present. Follow the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Error Monitoring & Alerting Setup. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Apply the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Error Monitoring & Alerting Setup\" — audit for Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains and apply the best practice fix.",
        "\"Secure Error Monitoring & Alerting Setup setup\" — review Sentry project config / alert rule / error grouping / source map upload / performance monitoring and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:harden",
          "security",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "fastapi-dependencies-harden",
      "name": "FastAPI Dependency Injection: Harden",
      "category": "Security",
      "description": "[FastAPI Dependency Injection] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "triggerPhrase": "Audit and harden \"FastAPI Dependency Injection\". The common failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\" may be present. Follow the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening FastAPI Dependency Injection. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Apply the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific dependency / lifespan handler / override for testing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden FastAPI Dependency Injection\" — audit for Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection and apply the best practice fix.",
        "\"Secure FastAPI Dependency Injection setup\" — review dependency / lifespan handler / override for testing and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:harden",
          "security",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "feature-flags-harden",
      "name": "Feature Flags & Gradual Rollouts: Harden",
      "category": "Security",
      "description": "[Feature Flags & Gradual Rollouts] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "triggerPhrase": "Audit and harden \"Feature Flags & Gradual Rollouts\". The common failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\" may be present. Follow the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Feature Flags & Gradual Rollouts. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Apply the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Feature Flags & Gradual Rollouts\" — audit for Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags and apply the best practice fix.",
        "\"Secure Feature Flags & Gradual Rollouts setup\" — review flag provider config / gradual rollout target / flag cleanup plan / A/B test flag and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:feature-flags",
          "workflow:harden",
          "security",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "git-conflict-resolution-harden",
      "name": "Git Conflict Resolution: Harden",
      "category": "Security",
      "description": "[Git Conflict Resolution] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "triggerPhrase": "Audit and harden \"Git Conflict Resolution\". The common failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\" may be present. Follow the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Git Conflict Resolution. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Apply the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Git Conflict Resolution\" — audit for Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs and apply the best practice fix.",
        "\"Secure Git Conflict Resolution setup\" — review conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:harden",
          "security",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "github-actions-pipeline-harden",
      "name": "GitHub Actions Pipeline Optimisation: Harden",
      "category": "Security",
      "description": "[GitHub Actions Pipeline Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "triggerPhrase": "Audit and harden \"GitHub Actions Pipeline Optimisation\". The common failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\" may be present. Follow the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening GitHub Actions Pipeline Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Apply the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden GitHub Actions Pipeline Optimisation\" — audit for Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope and apply the best practice fix.",
        "\"Secure GitHub Actions Pipeline Optimisation setup\" — review workflow YAML / cache config / matrix build / conditional job execution and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:harden",
          "security",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "graphql-n-plus-one-harden",
      "name": "GraphQL N+1 Query Prevention: Harden",
      "category": "Security",
      "description": "[GraphQL N+1 Query Prevention] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "triggerPhrase": "Audit and harden \"GraphQL N+1 Query Prevention\". The common failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\" may be present. Follow the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening GraphQL N+1 Query Prevention. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Apply the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden GraphQL N+1 Query Prevention\" — audit for A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children and apply the best practice fix.",
        "\"Secure GraphQL N+1 Query Prevention setup\" — review DataLoader instance / batch load function / resolver refactor / query complexity analysis and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:harden",
          "security",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "jest-test-optimization-harden",
      "name": "Jest Test Optimisation: Harden",
      "category": "Security",
      "description": "[Jest Test Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "triggerPhrase": "Audit and harden \"Jest Test Optimisation\". The common failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\" may be present. Follow the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Jest Test Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Apply the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Jest Test Optimisation\" — audit for Running the entire test suite on every change, taking minutes even for small incremental code changes and apply the best practice fix.",
        "\"Secure Jest Test Optimisation setup\" — review jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:jest-test-optimization",
          "workflow:harden",
          "security",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "json-schema-validation-harden",
      "name": "JSON Schema Validation: Harden",
      "category": "Security",
      "description": "[JSON Schema Validation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "triggerPhrase": "Audit and harden \"JSON Schema Validation\". The common failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\" may be present. Follow the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening JSON Schema Validation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Apply the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden JSON Schema Validation\" — audit for Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly and apply the best practice fix.",
        "\"Secure JSON Schema Validation setup\" — review JSON Schema / validator middleware / type guard / error message / response parser and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:json-schema-validation",
          "workflow:harden",
          "security",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-hpa-harden",
      "name": "Kubernetes Horizontal Pod Autoscaling: Harden",
      "category": "Security",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "triggerPhrase": "Audit and harden \"Kubernetes Horizontal Pod Autoscaling\". The common failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\" may be present. Follow the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Kubernetes Horizontal Pod Autoscaling. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Apply the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Kubernetes Horizontal Pod Autoscaling\" — audit for HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment and apply the best practice fix.",
        "\"Secure Kubernetes Horizontal Pod Autoscaling setup\" — review HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:harden",
          "security",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "kubernetes-pod-lifecycle-harden",
      "name": "Kubernetes Pod Lifecycle: Harden",
      "category": "Security",
      "description": "[Kubernetes Pod Lifecycle] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "triggerPhrase": "Audit and harden \"Kubernetes Pod Lifecycle\". The common failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\" may be present. Follow the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Kubernetes Pod Lifecycle. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Apply the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Kubernetes Pod Lifecycle\" — audit for Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready and apply the best practice fix.",
        "\"Secure Kubernetes Pod Lifecycle setup\" — review deployment.yaml / startup probe / readiness probe / liveness probe / init container and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:harden",
          "security",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "context-window-budget-harden",
      "name": "LLM Context Window Budget Management: Harden",
      "category": "Security",
      "description": "[LLM Context Window Budget Management] Audit for the failure pattern, apply the best practice, rank findings by severity Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "triggerPhrase": "Audit and harden \"LLM Context Window Budget Management\". The common failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\" may be present. Follow the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening LLM Context Window Budget Management. Audit for the failure pattern, apply the best practice, rank findings by severity. Check for: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Apply the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "checklist",
          "name": "chk",
          "description": "CHK output"
        }
      ],
      "examples": [
        "\"Harden LLM Context Window Budget Management\" — audit for Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content and apply the best practice fix.",
        "\"Secure LLM Context Window Budget Management setup\" — review trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:context-window-budget",
          "workflow:harden",
          "security",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "mcp-tool-design-harden",
      "name": "MCP Tool Design & Best Practices: Harden",
      "category": "Security",
      "description": "[MCP Tool Design & Best Practices] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "triggerPhrase": "Audit and harden \"MCP Tool Design & Best Practices\". The common failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\" may be present. Follow the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening MCP Tool Design & Best Practices. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Apply the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden MCP Tool Design & Best Practices\" — audit for Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent and apply the best practice fix.",
        "\"Secure MCP Tool Design & Best Practices setup\" — review MCP tool descriptor / resource definition / prompt template / server metadata and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:mcp-tool-design",
          "workflow:harden",
          "security",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "message-queues-harden",
      "name": "Message Queues & Background Jobs: Harden",
      "category": "Security",
      "description": "[Message Queues & Background Jobs] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "triggerPhrase": "Audit and harden \"Message Queues & Background Jobs\". The common failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\" may be present. Follow the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Message Queues & Background Jobs. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Apply the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Message Queues & Background Jobs\" — audit for Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled and apply the best practice fix.",
        "\"Secure Message Queues & Background Jobs setup\" — review queue producer / worker / dead-letter handler / retry policy and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:message-queues",
          "workflow:harden",
          "security",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "multi-tenant-isolation-harden",
      "name": "Multi-Tenant Data Isolation: Harden",
      "category": "Security",
      "description": "[Multi-Tenant Data Isolation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "triggerPhrase": "Audit and harden \"Multi-Tenant Data Isolation\". The common failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\" may be present. Follow the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Multi-Tenant Data Isolation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Apply the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Multi-Tenant Data Isolation\" — audit for Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data and apply the best practice fix.",
        "\"Secure Multi-Tenant Data Isolation setup\" — review RLS policy / tenant context middleware / session variable injection / tenant-aware query builder and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:harden",
          "security",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-api-routes-harden",
      "name": "Next.js API Routes & Route Handlers: Harden",
      "category": "Security",
      "description": "[Next.js API Routes & Route Handlers] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "triggerPhrase": "Audit and harden \"Next.js API Routes & Route Handlers\". The common failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\" may be present. Follow the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Next.js API Routes & Route Handlers. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Apply the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Next.js API Routes & Route Handlers\" — audit for Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component and apply the best practice fix.",
        "\"Secure Next.js API Routes & Route Handlers setup\" — review route.ts handler / server action / API client wrapper / error boundary and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:harden",
          "security",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-data-fetching-harden",
      "name": "Next.js Data Fetching Patterns: Harden",
      "category": "Security",
      "description": "[Next.js Data Fetching Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "triggerPhrase": "Audit and harden \"Next.js Data Fetching Patterns\". The common failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\" may be present. Follow the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Next.js Data Fetching Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Apply the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Next.js Data Fetching Patterns\" — audit for Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests and apply the best practice fix.",
        "\"Secure Next.js Data Fetching Patterns setup\" — review server fetch / React cache wrapper / streaming suspense boundary and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:harden",
          "security",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "nextjs-middleware-harden",
      "name": "Next.js Middleware & Edge Runtime: Harden",
      "category": "Security",
      "description": "[Next.js Middleware & Edge Runtime] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "triggerPhrase": "Audit and harden \"Next.js Middleware & Edge Runtime\". The common failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\" may be present. Follow the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Next.js Middleware & Edge Runtime. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Apply the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Next.js Middleware & Edge Runtime\" — audit for Using Node and apply the best practice fix.",
        "\"Secure Next.js Middleware & Edge Runtime setup\" — review middleware.ts / rewrite rule / cookie-based redirect / geolocation routing and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:nextjs-middleware",
          "workflow:harden",
          "security",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-error-handling-harden",
      "name": "Node.js Error Handling & Resilience: Harden",
      "category": "Security",
      "description": "[Node.js Error Handling & Resilience] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "triggerPhrase": "Audit and harden \"Node.js Error Handling & Resilience\". The common failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\" may be present. Follow the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Node.js Error Handling & Resilience. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Apply the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Node.js Error Handling & Resilience\" — audit for Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context and apply the best practice fix.",
        "\"Secure Node.js Error Handling & Resilience setup\" — review global error handler / async wrapper / structured error response / retry logic and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:node-error-handling",
          "workflow:harden",
          "security",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "node-streams-harden",
      "name": "Node.js Streams & Backpressure: Harden",
      "category": "Security",
      "description": "[Node.js Streams & Backpressure] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "triggerPhrase": "Audit and harden \"Node.js Streams & Backpressure\". The common failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\" may be present. Follow the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Node.js Streams & Backpressure. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Apply the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Node.js Streams & Backpressure\" — audit for Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams and apply the best practice fix.",
        "\"Secure Node.js Streams & Backpressure setup\" — review Readable/Writable stream / Transform / pipeline() refactor and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:node-streams",
          "workflow:harden",
          "security",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "oauth-flows-harden",
      "name": "OAuth 2.0 Flows & Token Management: Harden",
      "category": "Security",
      "description": "[OAuth 2.0 Flows & Token Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "triggerPhrase": "Audit and harden \"OAuth 2.0 Flows & Token Management\". The common failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\" may be present. Follow the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening OAuth 2.0 Flows & Token Management. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Apply the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden OAuth 2.0 Flows & Token Management\" — audit for Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation and apply the best practice fix.",
        "\"Secure OAuth 2.0 Flows & Token Management setup\" — review OAuth callback / token refresh / PKCE flow / httpOnly cookie handler and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:oauth-flows",
          "workflow:harden",
          "security",
          "oauth",
          "auth"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "openapi-spec-harden",
      "name": "OpenAPI Specification & Validation: Harden",
      "category": "Security",
      "description": "[OpenAPI Specification & Validation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "triggerPhrase": "Audit and harden \"OpenAPI Specification & Validation\". The common failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\" may be present. Follow the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening OpenAPI Specification & Validation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Apply the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden OpenAPI Specification & Validation\" — audit for Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code and apply the best practice fix.",
        "\"Secure OpenAPI Specification & Validation setup\" — review openapi.yaml / code-first generator / request/response validation middleware and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:openapi-spec",
          "workflow:harden",
          "security",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "playwright-selectors-harden",
      "name": "Playwright Selectors & Locators: Harden",
      "category": "Security",
      "description": "[Playwright Selectors & Locators] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "triggerPhrase": "Audit and harden \"Playwright Selectors & Locators\". The common failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\" may be present. Follow the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Playwright Selectors & Locators. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Apply the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Playwright Selectors & Locators\" — audit for Using fragile CSS selectors (nth-child, class names that change) that break on every UI update and apply the best practice fix.",
        "\"Secure Playwright Selectors & Locators setup\" — review locator refactor / test fixture / POM (Page Object Model) / custom fixture and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:playwright-selectors",
          "workflow:harden",
          "security",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "prompt-injection-defense-harden",
      "name": "Prompt Injection Defense: Harden",
      "category": "Security",
      "description": "[Prompt Injection Defense] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "triggerPhrase": "Audit and harden \"Prompt Injection Defense\". The common failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\" may be present. Follow the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Prompt Injection Defense. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Apply the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Prompt Injection Defense\" — audit for Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions' and apply the best practice fix.",
        "\"Secure Prompt Injection Defense setup\" — review defensive system prompt / input sanitizer / instruction guardrail / output validator and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:harden",
          "security",
          "prompt",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-async-harden",
      "name": "Python Async/Await Patterns: Harden",
      "category": "Security",
      "description": "[Python Async/Await Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "triggerPhrase": "Audit and harden \"Python Async/Await Patterns\". The common failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\" may be present. Follow the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Python Async/Await Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Apply the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Python Async/Await Patterns\" — audit for Blocking the event loop by using synchronous requests or time and apply the best practice fix.",
        "\"Secure Python Async/Await Patterns setup\" — review async/await refactor / asyncio.gather / async context manager and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:python-async",
          "workflow:harden",
          "security",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "python-file-io-harden",
      "name": "Python File I/O & Encoding: Harden",
      "category": "Security",
      "description": "[Python File I/O & Encoding] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "triggerPhrase": "Audit and harden \"Python File I/O & Encoding\". The common failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\" may be present. Follow the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Python File I/O & Encoding. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Apply the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Python File I/O & Encoding\" — audit for Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content and apply the best practice fix.",
        "\"Secure Python File I/O & Encoding setup\" — review pathlib refactor / encoding-safe file reader / batch file processor and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:python-file-io",
          "workflow:harden",
          "security",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rag-chunking-harden",
      "name": "RAG Chunking Strategies: Harden",
      "category": "Security",
      "description": "[RAG Chunking Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "triggerPhrase": "Audit and harden \"RAG Chunking Strategies\". The common failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\" may be present. Follow the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening RAG Chunking Strategies. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Apply the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden RAG Chunking Strategies\" — audit for Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality and apply the best practice fix.",
        "\"Secure RAG Chunking Strategies setup\" — review semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:rag-chunking",
          "workflow:harden",
          "security",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rate-limiting-proxy-harden",
      "name": "Rate Limiting & API Gateway Proxy: Harden",
      "category": "Security",
      "description": "[Rate Limiting & API Gateway Proxy] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "triggerPhrase": "Audit and harden \"Rate Limiting & API Gateway Proxy\". The common failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\" may be present. Follow the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Rate Limiting & API Gateway Proxy. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Apply the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Rate Limiting & API Gateway Proxy\" — audit for Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources and apply the best practice fix.",
        "\"Secure Rate Limiting & API Gateway Proxy setup\" — review NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:harden",
          "security",
          "rate-limiting",
          "proxy"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-server-components-harden",
      "name": "React Server Components: Harden",
      "category": "Security",
      "description": "[React Server Components] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "triggerPhrase": "Audit and harden \"React Server Components\". The common failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\" may be present. Follow the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening React Server Components. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Apply the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden React Server Components\" — audit for Accidentally making a server component a client component by using hooks or event handlers in the wrong file and apply the best practice fix.",
        "\"Secure React Server Components setup\" — review server component / client boundary refactor / streaming fallback and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:react-server-components",
          "workflow:harden",
          "security",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "react-state-harden",
      "name": "React State Management: Harden",
      "category": "Security",
      "description": "[React State Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "triggerPhrase": "Audit and harden \"React State Management\". The common failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\" may be present. Follow the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening React State Management. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Apply the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden React State Management\" — audit for Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation and apply the best practice fix.",
        "\"Secure React State Management setup\" — review useState / useReducer / useContext hook refactor, zustand or jotai store slice and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:react-state",
          "workflow:harden",
          "security",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "redis-caching-harden",
      "name": "Redis Caching Strategies: Harden",
      "category": "Security",
      "description": "[Redis Caching Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "triggerPhrase": "Audit and harden \"Redis Caching Strategies\". The common failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\" may be present. Follow the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Redis Caching Strategies. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Apply the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Redis Caching Strategies\" — audit for Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time and apply the best practice fix.",
        "\"Secure Redis Caching Strategies setup\" — review cache wrapper / mutex lock / stale-while-revalidate / TTL policy and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:redis-caching",
          "workflow:harden",
          "security",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "rest-pagination-harden",
      "name": "REST Pagination Design: Harden",
      "category": "Security",
      "description": "[REST Pagination Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "triggerPhrase": "Audit and harden \"REST Pagination Design\". The common failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\" may be present. Follow the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening REST Pagination Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Apply the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden REST Pagination Design\" — audit for Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows and apply the best practice fix.",
        "\"Secure REST Pagination Design setup\" — review cursor pagination / offset pagination fallback / total count optimisation / response envelope and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:rest-pagination",
          "workflow:harden",
          "security",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "secrets-rotation-harden",
      "name": "Secrets Rotation Policy: Harden",
      "category": "Security",
      "description": "[Secrets Rotation Policy] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "triggerPhrase": "Audit and harden \"Secrets Rotation Policy\". The common failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\" may be present. Follow the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Secrets Rotation Policy. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Apply the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Secrets Rotation Policy\" — audit for Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak and apply the best practice fix.",
        "\"Secure Secrets Rotation Policy setup\" — review rotation script / vault integration / lease management / incident response plan and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:secrets-rotation",
          "workflow:harden",
          "security",
          "secrets",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "shell-script-robustness-harden",
      "name": "Shell Script Robustness & Safety: Harden",
      "category": "Security",
      "description": "[Shell Script Robustness & Safety] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "triggerPhrase": "Audit and harden \"Shell Script Robustness & Safety\". The common failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\" may be present. Follow the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Shell Script Robustness & Safety. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Apply the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Shell Script Robustness & Safety\" — audit for Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage and apply the best practice fix.",
        "\"Secure Shell Script Robustness & Safety setup\" — review set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:shell-script-robustness",
          "workflow:harden",
          "security",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "sql-query-optimization-harden",
      "name": "SQL Query Optimisation: Harden",
      "category": "Security",
      "description": "[SQL Query Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "triggerPhrase": "Audit and harden \"SQL Query Optimisation\". The common failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\" may be present. Follow the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening SQL Query Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Apply the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden SQL Query Optimisation\" — audit for Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs and apply the best practice fix.",
        "\"Secure SQL Query Optimisation setup\" — review indexed query / composite index / EXPLAIN ANALYSE plan / partial index and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:sql-query-optimization",
          "workflow:harden",
          "security",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stealth-web-research-harden",
      "name": "Stealth Web Research & Harvesting: Harden",
      "category": "Security",
      "description": "[Stealth Web Research & Harvesting] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "triggerPhrase": "Audit and harden \"Stealth Web Research & Harvesting\". The common failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\" may be present. Follow the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Stealth Web Research & Harvesting. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Apply the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Stealth Web Research & Harvesting\" — audit for Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests and apply the best practice fix.",
        "\"Secure Stealth Web Research & Harvesting setup\" — review clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:stealth-web-research",
          "workflow:harden",
          "security",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "stripe-webhook-idempotency-harden",
      "name": "Stripe Webhook Idempotency: Harden",
      "category": "Security",
      "description": "[Stripe Webhook Idempotency] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "triggerPhrase": "Audit and harden \"Stripe Webhook Idempotency\". The common failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\" may be present. Follow the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Stripe Webhook Idempotency. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Apply the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Stripe Webhook Idempotency\" — audit for Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations and apply the best practice fix.",
        "\"Secure Stripe Webhook Idempotency setup\" — review Webhook handler / idempotency key check / event deduplication / failed payment recovery and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:harden",
          "security",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "supabase-rls-harden",
      "name": "Supabase Row-Level Security: Harden",
      "category": "Security",
      "description": "[Supabase Row-Level Security] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "triggerPhrase": "Audit and harden \"Supabase Row-Level Security\". The common failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\" may be present. Follow the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Supabase Row-Level Security. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Apply the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Supabase Row-Level Security\" — audit for RLS policies that are too permissive (using 'true' instead of 'auth and apply the best practice fix.",
        "\"Secure Supabase Row-Level Security setup\" — review RLS policy / policy test / security definer function / admin bypass and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:supabase-rls",
          "workflow:harden",
          "security",
          "supabase",
          "rls"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "terraform-state-harden",
      "name": "Terraform State Management: Harden",
      "category": "Security",
      "description": "[Terraform State Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "triggerPhrase": "Audit and harden \"Terraform State Management\". The common failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\" may be present. Follow the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Terraform State Management. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Apply the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Terraform State Management\" — audit for Losing the  and apply the best practice fix.",
        "\"Secure Terraform State Management setup\" — review backend config / state migration plan / state locking config / remote state datasource and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:terraform-state",
          "workflow:harden",
          "security",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "typescript-generics-harden",
      "name": "TypeScript Generics & Advanced Types: Harden",
      "category": "Security",
      "description": "[TypeScript Generics & Advanced Types] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "triggerPhrase": "Audit and harden \"TypeScript Generics & Advanced Types\". The common failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\" may be present. Follow the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening TypeScript Generics & Advanced Types. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Apply the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden TypeScript Generics & Advanced Types\" — audit for Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice) and apply the best practice fix.",
        "\"Secure TypeScript Generics & Advanced Types setup\" — review generic type / conditional type / mapped type / branded type and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:typescript-generics",
          "workflow:harden",
          "security",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "user-onboarding-flow-harden",
      "name": "User Onboarding Flow Design: Harden",
      "category": "Security",
      "description": "[User Onboarding Flow Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "triggerPhrase": "Audit and harden \"User Onboarding Flow Design\". The common failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\" may be present. Follow the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening User Onboarding Flow Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Apply the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden User Onboarding Flow Design\" — audit for Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value and apply the best practice fix.",
        "\"Secure User Onboarding Flow Design setup\" — review onboarding wizard / feature checklist / in-app guide / first-run experience spec and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:harden",
          "security",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "vercel-env-vars-harden",
      "name": "Vercel Environment Variables: Harden",
      "category": "Security",
      "description": "[Vercel Environment Variables] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "triggerPhrase": "Audit and harden \"Vercel Environment Variables\". The common failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\" may be present. Follow the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Vercel Environment Variables. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Apply the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Vercel Environment Variables\" — audit for Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments and apply the best practice fix.",
        "\"Secure Vercel Environment Variables setup\" — review vercel.json env group / preview env config / Edge Config / KV store and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:vercel-env-vars",
          "workflow:harden",
          "security",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-scraping-ethics-harden",
      "name": "Web Scraping Ethics & Compliance: Harden",
      "category": "Security",
      "description": "[Web Scraping Ethics & Compliance] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "triggerPhrase": "Audit and harden \"Web Scraping Ethics & Compliance\". The common failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\" may be present. Follow the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Web Scraping Ethics & Compliance. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Apply the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Web Scraping Ethics & Compliance\" — audit for Scraping a website that explicitly prohibits it in robots and apply the best practice fix.",
        "\"Secure Web Scraping Ethics & Compliance setup\" — review robots.txt check / polite scraper / rate-limited crawler / cached scraper and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:harden",
          "security",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "websocket-reconnection-harden",
      "name": "WebSocket Reconnection Strategies: Harden",
      "category": "Security",
      "description": "[WebSocket Reconnection Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "triggerPhrase": "Audit and harden \"WebSocket Reconnection Strategies\". The common failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\" may be present. Follow the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening WebSocket Reconnection Strategies. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Apply the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden WebSocket Reconnection Strategies\" — audit for Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state and apply the best practice fix.",
        "\"Secure WebSocket Reconnection Strategies setup\" — review WebSocket client / reconnection logic / heartbeat / connection status component and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:websocket-reconnection",
          "workflow:harden",
          "security",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "slug": "web-vitals-optimization-harden",
      "name": "Web Vitals Optimisation (LCP/CLS/INP): Harden",
      "category": "Security",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "triggerPhrase": "Audit and harden \"Web Vitals Optimisation (LCP/CLS/INP)\". The common failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\" may be present. Follow the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Produce a risk-ranked list of findings.",
      "promptTemplate": "You are hardening Web Vitals Optimisation (LCP/CLS/INP). Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Apply the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Rank findings by severity.",
      "inputs": [
        {
          "kind": "text",
          "name": "goal",
          "required": true,
          "description": "The precise outcome the user wants to achieve."
        },
        {
          "kind": "text",
          "name": "context",
          "required": false,
          "description": "Project, file, conversation or task context."
        },
        {
          "kind": "text",
          "name": "assets",
          "required": false,
          "description": "Relevant code, logs, URLs, documents or data samples."
        },
        {
          "kind": "text",
          "name": "domainArtifact",
          "required": false,
          "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
        }
      ],
      "outputs": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "examples": [
        "\"Harden Web Vitals Optimisation (LCP/CLS/INP)\" — audit for Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions) and apply the best practice fix.",
        "\"Secure Web Vitals Optimisation (LCP/CLS/INP) setup\" — review image optimisation / font display swap / critical CSS / lazy load / bundle analysis and produce a risk-ranked list."
      ],
      "metadata": {
        "risk": "high",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:harden",
          "security",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    }
  ]
}
__USB_SKILLPACK_JSON_DE117FFB3CF890BE__

write_file "$PACK_DIR/adapter.bridge.json" <<'__USB_ADAPTER_JSON_297FC90916FD0233__'
{
  "schemaVersion": "skill-bridge/v1",
  "generatedAt": "2026-06-18T19:55:31.156Z",
  "target": "auto",
  "adapter": {
    "files": [
      {
        "kind": "manifest",
        "path": "skillpack.json",
        "description": "Portable manifest containing all skills and adapter metadata."
      },
      {
        "kind": "skill",
        "path": "skills/*.md",
        "description": "Markdown skill files readable by any agent runtime."
      }
    ],
    "label": "Auto-detect Bridge",
    "notes": "Auto-detects the active agent runtime on your machine. LeoSIS folders are checked first, then Claude, Hermes, Cursor, LangChain, and finally falls back to generic markdown + JSON manifest when no known runtime is found.",
    "target": "auto",
    "commandHint": "curl -fsSL <host>/api/install?target=auto | bash",
    "installPath": "$AI_SKILL_HOME or $HOME/.ai-skills",
    "capabilities": [
      "runtime detection",
      "manifest sync",
      "portable markdown skills",
      "LeoSIS-first preference"
    ]
  },
  "pack": {
    "slug": "universal-skill-bridge-catalog",
    "name": "Universal Skill Bridge Catalog",
    "description": "A fully original, from-scratch catalog across 16 provider targets: 65 hand-researched engineering domains systematically expanded across 8 workflows (Audit, Plan, Build, Script, Diagnose, Harden, Explain, Tune) into 529 skills, plus 9 hand-written core orchestration skills. Every skill has a distinct trigger phrase, protocol prompt, input/output contract and examples — zero external dependencies.",
    "version": "0.4.1",
    "author": "Universal Skill Bridge"
  },
  "tools": [
    {
      "name": "a_b_testing_framework_audit",
      "title": "A/B Testing Framework: Audit",
      "description": "[A/B Testing Framework] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "trigger": "You need to examine the current \"A/B Testing Framework\" setup without making changes. Look for the specific failure pattern: \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing A/B Testing Framework. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Use the best practice Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle. as your evaluation baseline. Verify your findings with statsmodels sample size calculation + Bayesian A/B test + sequential testing. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:audit",
          "audit",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a11y_aria_patterns_audit",
      "title": "Accessibility ARIA Patterns: Audit",
      "description": "[Accessibility ARIA Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "trigger": "You need to examine the current \"Accessibility ARIA Patterns\" setup without making changes. Look for the specific failure pattern: \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Accessibility ARIA Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Use the best practice Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader. as your evaluation baseline. Verify your findings with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:audit",
          "audit",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "agent_tool_binding_audit",
      "title": "Agent Tool Binding & Dispatch: Audit",
      "description": "[Agent Tool Binding & Dispatch] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "trigger": "You need to examine the current \"Agent Tool Binding & Dispatch\" setup without making changes. Look for the specific failure pattern: \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Agent Tool Binding & Dispatch. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Use the best practice Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step. as your evaluation baseline. Verify your findings with agent trace log + tool invocation frequency analysis + token cost audit. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:agent-tool-binding",
          "workflow:audit",
          "audit",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "analytics_metric_definition_audit",
      "title": "Analytics Metric Definitions: Audit",
      "description": "[Analytics Metric Definitions] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "trigger": "You need to examine the current \"Analytics Metric Definitions\" setup without making changes. Look for the specific failure pattern: \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Analytics Metric Definitions. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Use the best practice Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly. as your evaluation baseline. Verify your findings with dbt docs generate + dbt test --select tag:metrics + metric comparison script. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:audit",
          "audit",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "adr_documentation_audit",
      "title": "Architecture Decision Records: Audit",
      "description": "[Architecture Decision Records] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "trigger": "You need to examine the current \"Architecture Decision Records\" setup without making changes. Look for the specific failure pattern: \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ADR document / decision log / template / review workflow this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Architecture Decision Records. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Use the best practice Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences. as your evaluation baseline. Verify your findings with adr-tools list + adr-tools generate + decision log index page. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:adr-documentation",
          "workflow:audit",
          "audit",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "aws_lambda_cold_start_audit",
      "title": "AWS Lambda Cold Starts: Audit",
      "description": "[AWS Lambda Cold Starts] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "trigger": "You need to examine the current \"AWS Lambda Cold Starts\" setup without making changes. Look for the specific failure pattern: \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing AWS Lambda Cold Starts. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Use the best practice Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions. as your evaluation baseline. Verify your findings with AWS X-Ray trace + Lambda Insights + cold start dashboard. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:audit",
          "audit",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "azure_bicep_audit",
      "title": "Azure Bicep Infrastructure: Audit",
      "description": "[Azure Bicep Infrastructure] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "trigger": "You need to examine the current \"Azure Bicep Infrastructure\" setup without making changes. Look for the specific failure pattern: \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific main.bicep / module / parameter file / azd template this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Azure Bicep Infrastructure. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Use the best practice Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic. as your evaluation baseline. Verify your findings with az deployment group validate + az what-if + bicep build. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:azure-bicep",
          "workflow:audit",
          "audit",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "browser_devtools_audit",
      "title": "Browser DevTools & Debugging: Audit",
      "description": "[Browser DevTools & Debugging] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "trigger": "You need to examine the current \"Browser DevTools & Debugging\" setup without making changes. Look for the specific failure pattern: \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Browser DevTools & Debugging. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Use the best practice Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM. as your evaluation baseline. Verify your findings with Chrome DevTools performance recording + memory heap snapshot + network throttle. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:browser-devtools",
          "workflow:audit",
          "audit",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cli_tool_design_audit",
      "title": "CLI Tool Design Patterns: Audit",
      "description": "[CLI Tool Design Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "trigger": "You need to examine the current \"CLI Tool Design Patterns\" setup without making changes. Look for the specific failure pattern: \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing CLI Tool Design Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Use the best practice Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output. as your evaluation baseline. Verify your findings with echo $? after CLI run + stderr redirection test + --json output validation. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cli-tool-design",
          "workflow:audit",
          "audit",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cloud_cost_optimization_audit",
      "title": "Cloud Cost Optimisation: Audit",
      "description": "[Cloud Cost Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "trigger": "You need to examine the current \"Cloud Cost Optimisation\" setup without making changes. Look for the specific failure pattern: \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Cloud Cost Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Use the best practice Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments. as your evaluation baseline. Verify your findings with cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:audit",
          "audit",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "code_review_checklist_audit",
      "title": "Code Review Checklist: Audit",
      "description": "[Code Review Checklist] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "trigger": "You need to examine the current \"Code Review Checklist\" setup without making changes. Look for the specific failure pattern: \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Code Review Checklist. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Use the best practice Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order. as your evaluation baseline. Verify your findings with git diff --stat + lint-staged + danger.js automated review + commitlint. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:code-review-checklist",
          "workflow:audit",
          "audit",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "convex_functions_audit",
      "title": "Convex Functions & Mutations: Audit",
      "description": "[Convex Functions & Mutations] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "trigger": "You need to examine the current \"Convex Functions & Mutations\" setup without making changes. Look for the specific failure pattern: \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific mutation / query / action / component / scheduler job this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Convex Functions & Mutations. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Use the best practice Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back. as your evaluation baseline. Verify your findings with npx convex dev + dashboard OCC conflict log + custom retry logic. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:convex-functions",
          "workflow:audit",
          "audit",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cron_job_reliability_audit",
      "title": "Cron Job & Scheduled Task Reliability: Audit",
      "description": "[Cron Job & Scheduled Task Reliability] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "trigger": "You need to examine the current \"Cron Job & Scheduled Task Reliability\" setup without making changes. Look for the specific failure pattern: \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Cron Job & Scheduled Task Reliability. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Use the best practice Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects. as your evaluation baseline. Verify your findings with tail -f /var/log/cron + systemctl status cron + idempotency test script. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cron-job-reliability",
          "workflow:audit",
          "audit",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "css_layout_audit",
      "title": "CSS Layout & Responsiveness: Audit",
      "description": "[CSS Layout & Responsiveness] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "trigger": "You need to examine the current \"CSS Layout & Responsiveness\" setup without making changes. Look for the specific failure pattern: \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing CSS Layout & Responsiveness. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Use the best practice Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints. as your evaluation baseline. Verify your findings with Lighthouse mobile emulation + browser DevTools responsive mode. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:css-layout",
          "workflow:audit",
          "audit",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "csv_data_cleaning_audit",
      "title": "CSV Data Cleaning Pipeline: Audit",
      "description": "[CSV Data Cleaning Pipeline] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "trigger": "You need to examine the current \"CSV Data Cleaning Pipeline\" setup without making changes. Look for the specific failure pattern: \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing CSV Data Cleaning Pipeline. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Use the best practice Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row. as your evaluation baseline. Verify your findings with python3 -c csv.DictReader + validation script + row count diff. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:audit",
          "audit",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "database_migration_safety_audit",
      "title": "Database Migration Safety: Audit",
      "description": "[Database Migration Safety] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "trigger": "You need to examine the current \"Database Migration Safety\" setup without making changes. Look for the specific failure pattern: \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Database Migration Safety. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Use the best practice Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default. as your evaluation baseline. Verify your findings with pg_locks monitoring during migration + batch backfill script + rollback test. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:database-migration-safety",
          "workflow:audit",
          "audit",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "data_warehouse_schema_audit",
      "title": "Data Warehouse Schema Design: Audit",
      "description": "[Data Warehouse Schema Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "trigger": "You need to examine the current \"Data Warehouse Schema Design\" setup without making changes. Look for the specific failure pattern: \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Data Warehouse Schema Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Use the best practice Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time. as your evaluation baseline. Verify your findings with dbt run + dbt test + query profiling with warehouse-native tools. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:audit",
          "audit",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "design_token_system_audit",
      "title": "Design Token Systems: Audit",
      "description": "[Design Token Systems] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "trigger": "You need to examine the current \"Design Token Systems\" setup without making changes. Look for the specific failure pattern: \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Design Token Systems. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Use the best practice Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values. as your evaluation baseline. Verify your findings with style-dictionary build + Storybook token viewer + token value comparison. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:design-token-system",
          "workflow:audit",
          "audit",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_compose_networking_audit",
      "title": "Docker Compose Networking: Audit",
      "description": "[Docker Compose Networking] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "trigger": "You need to examine the current \"Docker Compose Networking\" setup without making changes. Look for the specific failure pattern: \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Docker Compose Networking. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Use the best practice All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'. as your evaluation baseline. Verify your findings with docker compose up --wait + docker network inspect + container logs. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-compose-networking",
          "workflow:audit",
          "audit",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_multistage_audit",
      "title": "Docker Multi-Stage Builds: Audit",
      "description": "[Docker Multi-Stage Builds] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "trigger": "You need to examine the current \"Docker Multi-Stage Builds\" setup without making changes. Look for the specific failure pattern: \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Docker Multi-Stage Builds. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Use the best practice Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app. as your evaluation baseline. Verify your findings with docker build + docker scout + dive layer analysis. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-multistage",
          "workflow:audit",
          "audit",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "drizzle_schema_design_audit",
      "title": "Drizzle Schema Design: Audit",
      "description": "[Drizzle Schema Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "trigger": "You need to examine the current \"Drizzle Schema Design\" setup without making changes. Look for the specific failure pattern: \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Drizzle Schema Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Use the best practice Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly. as your evaluation baseline. Verify your findings with drizzle-kit push + drizzle-kit studio + generated SQL audit. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:audit",
          "audit",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "error_monitoring_setup_audit",
      "title": "Error Monitoring & Alerting Setup: Audit",
      "description": "[Error Monitoring & Alerting Setup] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "trigger": "You need to examine the current \"Error Monitoring & Alerting Setup\" setup without making changes. Look for the specific failure pattern: \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Error Monitoring & Alerting Setup. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Use the best practice Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold). as your evaluation baseline. Verify your findings with Sentry API error list + alert rule test + source map validation. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:audit",
          "audit",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "fastapi_dependencies_audit",
      "title": "FastAPI Dependency Injection: Audit",
      "description": "[FastAPI Dependency Injection] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "trigger": "You need to examine the current \"FastAPI Dependency Injection\" setup without making changes. Look for the specific failure pattern: \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific dependency / lifespan handler / override for testing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing FastAPI Dependency Injection. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Use the best practice Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends(). as your evaluation baseline. Verify your findings with uvicorn --reload + /docs interactive test + dependency graph visualisation. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:audit",
          "audit",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "feature_flags_audit",
      "title": "Feature Flags & Gradual Rollouts: Audit",
      "description": "[Feature Flags & Gradual Rollouts] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "trigger": "You need to examine the current \"Feature Flags & Gradual Rollouts\" setup without making changes. Look for the specific failure pattern: \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Feature Flags & Gradual Rollouts. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Use the best practice Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely. as your evaluation baseline. Verify your findings with flag evaluation log + rollout percentage monitoring + unused flag scan. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:feature-flags",
          "workflow:audit",
          "audit",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "git_conflict_resolution_audit",
      "title": "Git Conflict Resolution: Audit",
      "description": "[Git Conflict Resolution] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "trigger": "You need to examine the current \"Git Conflict Resolution\" setup without making changes. Look for the specific failure pattern: \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Git Conflict Resolution. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Use the best practice For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution. as your evaluation baseline. Verify your findings with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:audit",
          "audit",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "github_actions_pipeline_audit",
      "title": "GitHub Actions Pipeline Optimisation: Audit",
      "description": "[GitHub Actions Pipeline Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "trigger": "You need to examine the current \"GitHub Actions Pipeline Optimisation\" setup without making changes. Look for the specific failure pattern: \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing GitHub Actions Pipeline Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Use the best practice Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs. as your evaluation baseline. Verify your findings with act --job test + cache hit/miss analysis + workflow graph visualisation. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:audit",
          "audit",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "graphql_n_plus_one_audit",
      "title": "GraphQL N+1 Query Prevention: Audit",
      "description": "[GraphQL N+1 Query Prevention] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "trigger": "You need to examine the current \"GraphQL N+1 Query Prevention\" setup without making changes. Look for the specific failure pattern: \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing GraphQL N+1 Query Prevention. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Use the best practice Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle. as your evaluation baseline. Verify your findings with graphql query with tracing + DataLoader statistics + SQL log analysis. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:audit",
          "audit",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "jest_test_optimization_audit",
      "title": "Jest Test Optimisation: Audit",
      "description": "[Jest Test Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "trigger": "You need to examine the current \"Jest Test Optimisation\" setup without making changes. Look for the specific failure pattern: \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Jest Test Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Use the best practice Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback. as your evaluation baseline. Verify your findings with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:jest-test-optimization",
          "workflow:audit",
          "audit",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "json_schema_validation_audit",
      "title": "JSON Schema Validation: Audit",
      "description": "[JSON Schema Validation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "trigger": "You need to examine the current \"JSON Schema Validation\" setup without making changes. Look for the specific failure pattern: \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing JSON Schema Validation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Use the best practice Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation. as your evaluation baseline. Verify your findings with ajv validate + JSON Schema test suite + response mock test. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:json-schema-validation",
          "workflow:audit",
          "audit",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_hpa_audit",
      "title": "Kubernetes Horizontal Pod Autoscaling: Audit",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "trigger": "You need to examine the current \"Kubernetes Horizontal Pod Autoscaling\" setup without making changes. Look for the specific failure pattern: \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Kubernetes Horizontal Pod Autoscaling. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Use the best practice Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined. as your evaluation baseline. Verify your findings with kubectl get hpa --watch + kubectl top pods + metrics-server logs. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:audit",
          "audit",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_pod_lifecycle_audit",
      "title": "Kubernetes Pod Lifecycle: Audit",
      "description": "[Kubernetes Pod Lifecycle] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "trigger": "You need to examine the current \"Kubernetes Pod Lifecycle\" setup without making changes. Look for the specific failure pattern: \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Kubernetes Pod Lifecycle. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Use the best practice Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity. as your evaluation baseline. Verify your findings with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:audit",
          "audit",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "context_window_budget_audit",
      "title": "LLM Context Window Budget Management: Audit",
      "description": "[LLM Context Window Budget Management] Audit the current setup; do NOT modify files; produce a structured inventory and a risk-ranked list of findings Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "trigger": "You need to examine the current \"LLM Context Window Budget Management\" setup without making changes. Look for the specific failure pattern: \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "checklist",
          "name": "chk",
          "description": "CHK output"
        }
      ],
      "promptTemplate": "You are auditing LLM Context Window Budget Management. Follow Audit the current setup; do NOT modify files; produce a structured inventory and a risk-ranked list of findings. Specifically check for: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Use the best practice Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible. as your evaluation baseline. Verify your findings with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:context-window-budget",
          "workflow:audit",
          "audit",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "mcp_tool_design_audit",
      "title": "MCP Tool Design & Best Practices: Audit",
      "description": "[MCP Tool Design & Best Practices] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "trigger": "You need to examine the current \"MCP Tool Design & Best Practices\" setup without making changes. Look for the specific failure pattern: \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing MCP Tool Design & Best Practices. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Use the best practice Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool. as your evaluation baseline. Verify your findings with mcp-cli run + mcp inspector + tool name conflict analysis. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:mcp-tool-design",
          "workflow:audit",
          "audit",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "message_queues_audit",
      "title": "Message Queues & Background Jobs: Audit",
      "description": "[Message Queues & Background Jobs] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "trigger": "You need to examine the current \"Message Queues & Background Jobs\" setup without making changes. Look for the specific failure pattern: \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Message Queues & Background Jobs. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Use the best practice Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted. as your evaluation baseline. Verify your findings with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:message-queues",
          "workflow:audit",
          "audit",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "multi_tenant_isolation_audit",
      "title": "Multi-Tenant Data Isolation: Audit",
      "description": "[Multi-Tenant Data Isolation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "trigger": "You need to examine the current \"Multi-Tenant Data Isolation\" setup without making changes. Look for the specific failure pattern: \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Multi-Tenant Data Isolation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Use the best practice Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause. as your evaluation baseline. Verify your findings with RLS policy test with two different tenant sessions + data leakage check. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:audit",
          "audit",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_api_routes_audit",
      "title": "Next.js API Routes & Route Handlers: Audit",
      "description": "[Next.js API Routes & Route Handlers] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "trigger": "You need to examine the current \"Next.js API Routes & Route Handlers\" setup without making changes. Look for the specific failure pattern: \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Next.js API Routes & Route Handlers. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Use the best practice All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components. as your evaluation baseline. Verify your findings with curl --verbose + API route error log + status code audit. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:audit",
          "audit",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_data_fetching_audit",
      "title": "Next.js Data Fetching Patterns: Audit",
      "description": "[Next.js Data Fetching Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "trigger": "You need to examine the current \"Next.js Data Fetching Patterns\" setup without making changes. Look for the specific failure pattern: \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Next.js Data Fetching Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Use the best practice Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes. as your evaluation baseline. Verify your findings with next build --debug + React DevTools fetch profiling. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:audit",
          "audit",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_middleware_audit",
      "title": "Next.js Middleware & Edge Runtime: Audit",
      "description": "[Next.js Middleware & Edge Runtime] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "trigger": "You need to examine the current \"Next.js Middleware & Edge Runtime\" setup without making changes. Look for the specific failure pattern: \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Next.js Middleware & Edge Runtime. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Use the best practice Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks. as your evaluation baseline. Verify your findings with next dev + curl --cookie tests + edge runtime log inspection. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-middleware",
          "workflow:audit",
          "audit",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_error_handling_audit",
      "title": "Node.js Error Handling & Resilience: Audit",
      "description": "[Node.js Error Handling & Resilience] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "trigger": "You need to examine the current \"Node.js Error Handling & Resilience\" setup without making changes. Look for the specific failure pattern: \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Node.js Error Handling & Resilience. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Use the best practice Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function. as your evaluation baseline. Verify your findings with node --unhandled-rejections=strict + process.on('uncaughtException') log. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-error-handling",
          "workflow:audit",
          "audit",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_streams_audit",
      "title": "Node.js Streams & Backpressure: Audit",
      "description": "[Node.js Streams & Backpressure] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "trigger": "You need to examine the current \"Node.js Streams & Backpressure\" setup without making changes. Look for the specific failure pattern: \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Node.js Streams & Backpressure. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Use the best practice Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error. as your evaluation baseline. Verify your findings with Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-streams",
          "workflow:audit",
          "audit",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "oauth_flows_audit",
      "title": "OAuth 2.0 Flows & Token Management: Audit",
      "description": "[OAuth 2.0 Flows & Token Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "trigger": "You need to examine the current \"OAuth 2.0 Flows & Token Management\" setup without making changes. Look for the specific failure pattern: \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing OAuth 2.0 Flows & Token Management. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Use the best practice Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use. as your evaluation baseline. Verify your findings with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:oauth-flows",
          "workflow:audit",
          "audit",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "openapi_spec_audit",
      "title": "OpenAPI Specification & Validation: Audit",
      "description": "[OpenAPI Specification & Validation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "trigger": "You need to examine the current \"OpenAPI Specification & Validation\" setup without making changes. Look for the specific failure pattern: \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing OpenAPI Specification & Validation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Use the best practice Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes. as your evaluation baseline. Verify your findings with redocly lint + openapi-diff + swagger-ui preview. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:openapi-spec",
          "workflow:audit",
          "audit",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "playwright_selectors_audit",
      "title": "Playwright Selectors & Locators: Audit",
      "description": "[Playwright Selectors & Locators] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "trigger": "You need to examine the current \"Playwright Selectors & Locators\" setup without making changes. Look for the specific failure pattern: \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Playwright Selectors & Locators. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Use the best practice Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes. as your evaluation baseline. Verify your findings with playwright test --reporter=html + playwright codegen + trace viewer. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:playwright-selectors",
          "workflow:audit",
          "audit",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "prompt_injection_defense_audit",
      "title": "Prompt Injection Defense: Audit",
      "description": "[Prompt Injection Defense] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "trigger": "You need to examine the current \"Prompt Injection Defense\" setup without making changes. Look for the specific failure pattern: \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Prompt Injection Defense. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Use the best practice Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts. as your evaluation baseline. Verify your findings with prompt injection test suite + adversarial input fuzzing + output scanner. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:audit",
          "audit",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_async_audit",
      "title": "Python Async/Await Patterns: Audit",
      "description": "[Python Async/Await Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "trigger": "You need to examine the current \"Python Async/Await Patterns\" setup without making changes. Look for the specific failure pattern: \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Python Async/Await Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Use the best practice Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function. as your evaluation baseline. Verify your findings with python3 -m asyncio + aiohttp/httpx async benchmark. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-async",
          "workflow:audit",
          "audit",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_file_io_audit",
      "title": "Python File I/O & Encoding: Audit",
      "description": "[Python File I/O & Encoding] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "trigger": "You need to examine the current \"Python File I/O & Encoding\" setup without making changes. Look for the specific failure pattern: \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Python File I/O & Encoding. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Use the best practice Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code. as your evaluation baseline. Verify your findings with python3 -c with open() + chardet encoding detection. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-file-io",
          "workflow:audit",
          "audit",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rag_chunking_audit",
      "title": "RAG Chunking Strategies: Audit",
      "description": "[RAG Chunking Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "trigger": "You need to examine the current \"RAG Chunking Strategies\" setup without making changes. Look for the specific failure pattern: \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing RAG Chunking Strategies. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Use the best practice Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries. as your evaluation baseline. Verify your findings with retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rag-chunking",
          "workflow:audit",
          "audit",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rate_limiting_proxy_audit",
      "title": "Rate Limiting & API Gateway Proxy: Audit",
      "description": "[Rate Limiting & API Gateway Proxy] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "trigger": "You need to examine the current \"Rate Limiting & API Gateway Proxy\" setup without making changes. Look for the specific failure pattern: \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Rate Limiting & API Gateway Proxy. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Use the best practice Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server. as your evaluation baseline. Verify your findings with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:audit",
          "audit",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_server_components_audit",
      "title": "React Server Components: Audit",
      "description": "[React Server Components] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "trigger": "You need to examine the current \"React Server Components\" setup without making changes. Look for the specific failure pattern: \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing React Server Components. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Use the best practice Keep data fetching and heavy logic in server components; pass results as props to client islands. as your evaluation baseline. Verify your findings with next build --debug + React Server Components lint rule. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-server-components",
          "workflow:audit",
          "audit",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_state_audit",
      "title": "React State Management: Audit",
      "description": "[React State Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "trigger": "You need to examine the current \"React State Management\" setup without making changes. Look for the specific failure pattern: \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing React State Management. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Use the best practice Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it. as your evaluation baseline. Verify your findings with React DevTools profiler + why-did-you-render. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-state",
          "workflow:audit",
          "audit",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "redis_caching_audit",
      "title": "Redis Caching Strategies: Audit",
      "description": "[Redis Caching Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "trigger": "You need to examine the current \"Redis Caching Strategies\" setup without making changes. Look for the specific failure pattern: \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Redis Caching Strategies. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Use the best practice Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed. as your evaluation baseline. Verify your findings with redis-cli --stat + cache hit ratio monitoring + slow log. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:redis-caching",
          "workflow:audit",
          "audit",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rest_pagination_audit",
      "title": "REST Pagination Design: Audit",
      "description": "[REST Pagination Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "trigger": "You need to examine the current \"REST Pagination Design\" setup without making changes. Look for the specific failure pattern: \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing REST Pagination Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Use the best practice Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value. as your evaluation baseline. Verify your findings with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rest-pagination",
          "workflow:audit",
          "audit",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "secrets_rotation_audit",
      "title": "Secrets Rotation Policy: Audit",
      "description": "[Secrets Rotation Policy] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "trigger": "You need to examine the current \"Secrets Rotation Policy\" setup without making changes. Look for the specific failure pattern: \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Secrets Rotation Policy. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Use the best practice Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files. as your evaluation baseline. Verify your findings with vault lease list + secret expiry check + rotation dry-run test. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:secrets-rotation",
          "workflow:audit",
          "audit",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "shell_script_robustness_audit",
      "title": "Shell Script Robustness & Safety: Audit",
      "description": "[Shell Script Robustness & Safety] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "trigger": "You need to examine the current \"Shell Script Robustness & Safety\" setup without making changes. Look for the specific failure pattern: \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Shell Script Robustness & Safety. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Use the best practice Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script. as your evaluation baseline. Verify your findings with shellcheck script.sh + bash -n script.sh + dry-run mode test. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:shell-script-robustness",
          "workflow:audit",
          "audit",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "sql_query_optimization_audit",
      "title": "SQL Query Optimisation: Audit",
      "description": "[SQL Query Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "trigger": "You need to examine the current \"SQL Query Optimisation\" setup without making changes. Look for the specific failure pattern: \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing SQL Query Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Use the best practice Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly. as your evaluation baseline. Verify your findings with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:sql-query-optimization",
          "workflow:audit",
          "audit",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stealth_web_research_audit",
      "title": "Stealth Web Research & Harvesting: Audit",
      "description": "[Stealth Web Research & Harvesting] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "trigger": "You need to examine the current \"Stealth Web Research & Harvesting\" setup without making changes. Look for the specific failure pattern: \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Stealth Web Research & Harvesting. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Use the best practice Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers. as your evaluation baseline. Verify your findings with playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stealth-web-research",
          "workflow:audit",
          "audit",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stripe_webhook_idempotency_audit",
      "title": "Stripe Webhook Idempotency: Audit",
      "description": "[Stripe Webhook Idempotency] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "trigger": "You need to examine the current \"Stripe Webhook Idempotency\" setup without making changes. Look for the specific failure pattern: \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Stripe Webhook Idempotency. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Use the best practice Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events. as your evaluation baseline. Verify your findings with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:audit",
          "audit",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "supabase_rls_audit",
      "title": "Supabase Row-Level Security: Audit",
      "description": "[Supabase Row-Level Security] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "trigger": "You need to examine the current \"Supabase Row-Level Security\" setup without making changes. Look for the specific failure pattern: \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Supabase Row-Level Security. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Use the best practice Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production. as your evaluation baseline. Verify your findings with supabase db check + supabase db test + RLS policy review with pg_policies. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:supabase-rls",
          "workflow:audit",
          "audit",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "terraform_state_audit",
      "title": "Terraform State Management: Audit",
      "description": "[Terraform State Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "trigger": "You need to examine the current \"Terraform State Management\" setup without making changes. Look for the specific failure pattern: \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Terraform State Management. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Use the best practice Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent. as your evaluation baseline. Verify your findings with terraform plan + terraform state list + terraform state pull | jq. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:terraform-state",
          "workflow:audit",
          "audit",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "typescript_generics_audit",
      "title": "TypeScript Generics & Advanced Types: Audit",
      "description": "[TypeScript Generics & Advanced Types] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "trigger": "You need to examine the current \"TypeScript Generics & Advanced Types\" setup without making changes. Look for the specific failure pattern: \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing TypeScript Generics & Advanced Types. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Use the best practice Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property. as your evaluation baseline. Verify your findings with tsc --noEmit --strict + type tests with expect-type. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:typescript-generics",
          "workflow:audit",
          "audit",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "user_onboarding_flow_audit",
      "title": "User Onboarding Flow Design: Audit",
      "description": "[User Onboarding Flow Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "trigger": "You need to examine the current \"User Onboarding Flow Design\" setup without making changes. Look for the specific failure pattern: \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing User Onboarding Flow Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Use the best practice Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal. as your evaluation baseline. Verify your findings with analytics funnel analysis + onboarding completion rate + drop-off heatmap. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:audit",
          "audit",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "vercel_env_vars_audit",
      "title": "Vercel Environment Variables: Audit",
      "description": "[Vercel Environment Variables] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "trigger": "You need to examine the current \"Vercel Environment Variables\" setup without making changes. Look for the specific failure pattern: \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Vercel Environment Variables. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Use the best practice Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'. as your evaluation baseline. Verify your findings with vercel env pull + vercel list + project settings audit. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:vercel-env-vars",
          "workflow:audit",
          "audit",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_scraping_ethics_audit",
      "title": "Web Scraping Ethics & Compliance: Audit",
      "description": "[Web Scraping Ethics & Compliance] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "trigger": "You need to examine the current \"Web Scraping Ethics & Compliance\" setup without making changes. Look for the specific failure pattern: \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Web Scraping Ethics & Compliance. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Use the best practice Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information. as your evaluation baseline. Verify your findings with curl robots.txt + wget --wait + scraper log audit. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:audit",
          "audit",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "websocket_reconnection_audit",
      "title": "WebSocket Reconnection Strategies: Audit",
      "description": "[WebSocket Reconnection Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "trigger": "You need to examine the current \"WebSocket Reconnection Strategies\" setup without making changes. Look for the specific failure pattern: \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing WebSocket Reconnection Strategies. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Use the best practice Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI. as your evaluation baseline. Verify your findings with Browser DevTools Network tab WS filter + reconnection test with server restart. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:websocket-reconnection",
          "workflow:audit",
          "audit",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_vitals_optimization_audit",
      "title": "Web Vitals Optimisation (LCP/CLS/INP): Audit",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "trigger": "You need to examine the current \"Web Vitals Optimisation (LCP/CLS/INP)\" setup without making changes. Look for the specific failure pattern: \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\". Call this when you want a structured inventory before deciding what to modify.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are auditing Web Vitals Optimisation (LCP/CLS/INP). Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Use the best practice Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation. as your evaluation baseline. Verify your findings with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Do not modify any files.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:audit",
          "audit",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a_b_testing_framework_script",
      "title": "A/B Testing Framework: Script",
      "description": "[A/B Testing Framework] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "trigger": "Create a reusable automation for \"A/B Testing Framework\". The task produces experiment spec / variant assignment / metric definition / statistical analysis script. Handle the failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\". Include a dry-run mode and test with statsmodels sample size calculation + Bayesian A/B test + sequential testing.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for A/B Testing Framework. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with experiment spec / variant assignment / metric definition / statistical analysis script. Guard against: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Test with statsmodels sample size calculation + Bayesian A/B test + sequential testing.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:script",
          "automation",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a11y_aria_patterns_script",
      "title": "Accessibility ARIA Patterns: Script",
      "description": "[Accessibility ARIA Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "trigger": "Create a reusable automation for \"Accessibility ARIA Patterns\". The task produces ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Handle the failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\". Include a dry-run mode and test with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Accessibility ARIA Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Guard against: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Test with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:script",
          "automation",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "agent_tool_binding_script",
      "title": "Agent Tool Binding & Dispatch: Script",
      "description": "[Agent Tool Binding & Dispatch] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "trigger": "Create a reusable automation for \"Agent Tool Binding & Dispatch\". The task produces router tool / domain group / dynamic tool injection / tool usage statistics. Handle the failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\". Include a dry-run mode and test with agent trace log + tool invocation frequency analysis + token cost audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Agent Tool Binding & Dispatch. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with router tool / domain group / dynamic tool injection / tool usage statistics. Guard against: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Test with agent trace log + tool invocation frequency analysis + token cost audit.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:agent-tool-binding",
          "workflow:script",
          "automation",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "analytics_metric_definition_script",
      "title": "Analytics Metric Definitions: Script",
      "description": "[Analytics Metric Definitions] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "trigger": "Create a reusable automation for \"Analytics Metric Definitions\". The task produces metric definition / dbt model / SQL logic / dashboard tile / documentation. Handle the failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\". Include a dry-run mode and test with dbt docs generate + dbt test --select tag:metrics + metric comparison script.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Analytics Metric Definitions. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with metric definition / dbt model / SQL logic / dashboard tile / documentation. Guard against: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Test with dbt docs generate + dbt test --select tag:metrics + metric comparison script.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:script",
          "automation",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "adr_documentation_script",
      "title": "Architecture Decision Records: Script",
      "description": "[Architecture Decision Records] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "trigger": "Create a reusable automation for \"Architecture Decision Records\". The task produces ADR document / decision log / template / review workflow. Handle the failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\". Include a dry-run mode and test with adr-tools list + adr-tools generate + decision log index page.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ADR document / decision log / template / review workflow this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Architecture Decision Records. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with ADR document / decision log / template / review workflow. Guard against: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Test with adr-tools list + adr-tools generate + decision log index page.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:adr-documentation",
          "workflow:script",
          "automation",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "aws_lambda_cold_start_script",
      "title": "AWS Lambda Cold Starts: Script",
      "description": "[AWS Lambda Cold Starts] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "trigger": "Create a reusable automation for \"AWS Lambda Cold Starts\". The task produces handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Handle the failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\". Include a dry-run mode and test with AWS X-Ray trace + Lambda Insights + cold start dashboard.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for AWS Lambda Cold Starts. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Guard against: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Test with AWS X-Ray trace + Lambda Insights + cold start dashboard.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:script",
          "automation",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "azure_bicep_script",
      "title": "Azure Bicep Infrastructure: Script",
      "description": "[Azure Bicep Infrastructure] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "trigger": "Create a reusable automation for \"Azure Bicep Infrastructure\". The task produces main.bicep / module / parameter file / azd template. Handle the failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\". Include a dry-run mode and test with az deployment group validate + az what-if + bicep build.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific main.bicep / module / parameter file / azd template this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Azure Bicep Infrastructure. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with main.bicep / module / parameter file / azd template. Guard against: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Test with az deployment group validate + az what-if + bicep build.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:azure-bicep",
          "workflow:script",
          "automation",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "browser_devtools_script",
      "title": "Browser DevTools & Debugging: Script",
      "description": "[Browser DevTools & Debugging] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "trigger": "Create a reusable automation for \"Browser DevTools & Debugging\". The task produces debugging workflow / breakpoint guide / performance recording / memory snapshot. Handle the failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\". Include a dry-run mode and test with Chrome DevTools performance recording + memory heap snapshot + network throttle.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Browser DevTools & Debugging. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with debugging workflow / breakpoint guide / performance recording / memory snapshot. Guard against: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Test with Chrome DevTools performance recording + memory heap snapshot + network throttle.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:browser-devtools",
          "workflow:script",
          "automation",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cli_tool_design_script",
      "title": "CLI Tool Design Patterns: Script",
      "description": "[CLI Tool Design Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "trigger": "Create a reusable automation for \"CLI Tool Design Patterns\". The task produces CLI scaffolding / argument parser / exit code handler / --json output mode. Handle the failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\". Include a dry-run mode and test with echo $? after CLI run + stderr redirection test + --json output validation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for CLI Tool Design Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with CLI scaffolding / argument parser / exit code handler / --json output mode. Guard against: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Test with echo $? after CLI run + stderr redirection test + --json output validation.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cli-tool-design",
          "workflow:script",
          "automation",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cloud_cost_optimization_script",
      "title": "Cloud Cost Optimisation: Script",
      "description": "[Cloud Cost Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "trigger": "Create a reusable automation for \"Cloud Cost Optimisation\". The task produces right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Handle the failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\". Include a dry-run mode and test with cloud cost explorer + instance utilisation report + auto-stop Lambda function test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Cloud Cost Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Guard against: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Test with cloud cost explorer + instance utilisation report + auto-stop Lambda function test.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:script",
          "automation",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "code_review_checklist_script",
      "title": "Code Review Checklist: Script",
      "description": "[Code Review Checklist] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "trigger": "Create a reusable automation for \"Code Review Checklist\". The task produces review checklist / automated review comment / risk classification / diff summary. Handle the failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\". Include a dry-run mode and test with git diff --stat + lint-staged + danger.js automated review + commitlint.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Code Review Checklist. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with review checklist / automated review comment / risk classification / diff summary. Guard against: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Test with git diff --stat + lint-staged + danger.js automated review + commitlint.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:code-review-checklist",
          "workflow:script",
          "automation",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "convex_functions_script",
      "title": "Convex Functions & Mutations: Script",
      "description": "[Convex Functions & Mutations] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "trigger": "Create a reusable automation for \"Convex Functions & Mutations\". The task produces mutation / query / action / component / scheduler job. Handle the failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\". Include a dry-run mode and test with npx convex dev + dashboard OCC conflict log + custom retry logic.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific mutation / query / action / component / scheduler job this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Convex Functions & Mutations. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with mutation / query / action / component / scheduler job. Guard against: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Test with npx convex dev + dashboard OCC conflict log + custom retry logic.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:convex-functions",
          "workflow:script",
          "automation",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cron_job_reliability_script",
      "title": "Cron Job & Scheduled Task Reliability: Script",
      "description": "[Cron Job & Scheduled Task Reliability] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "trigger": "Create a reusable automation for \"Cron Job & Scheduled Task Reliability\". The task produces crontab entry / log rotation / idempotency guard / failure alert integration. Handle the failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\". Include a dry-run mode and test with tail -f /var/log/cron + systemctl status cron + idempotency test script.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Cron Job & Scheduled Task Reliability. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with crontab entry / log rotation / idempotency guard / failure alert integration. Guard against: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Test with tail -f /var/log/cron + systemctl status cron + idempotency test script.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cron-job-reliability",
          "workflow:script",
          "automation",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "css_layout_script",
      "title": "CSS Layout & Responsiveness: Script",
      "description": "[CSS Layout & Responsiveness] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "trigger": "Create a reusable automation for \"CSS Layout & Responsiveness\". The task produces CSS layout refactor / responsive grid / container query implementation. Handle the failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\". Include a dry-run mode and test with Lighthouse mobile emulation + browser DevTools responsive mode.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for CSS Layout & Responsiveness. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with CSS layout refactor / responsive grid / container query implementation. Guard against: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Test with Lighthouse mobile emulation + browser DevTools responsive mode.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:css-layout",
          "workflow:script",
          "automation",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "csv_data_cleaning_script",
      "title": "CSV Data Cleaning Pipeline: Script",
      "description": "[CSV Data Cleaning Pipeline] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "trigger": "Create a reusable automation for \"CSV Data Cleaning Pipeline\". The task produces CSV parser / row validator / column type mapper / error report / cleaned output. Handle the failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\". Include a dry-run mode and test with python3 -c csv.DictReader + validation script + row count diff.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for CSV Data Cleaning Pipeline. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with CSV parser / row validator / column type mapper / error report / cleaned output. Guard against: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Test with python3 -c csv.DictReader + validation script + row count diff.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:script",
          "automation",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "database_migration_safety_script",
      "title": "Database Migration Safety: Script",
      "description": "[Database Migration Safety] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "trigger": "Create a reusable automation for \"Database Migration Safety\". The task produces batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Handle the failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\". Include a dry-run mode and test with pg_locks monitoring during migration + batch backfill script + rollback test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Database Migration Safety. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Guard against: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Test with pg_locks monitoring during migration + batch backfill script + rollback test.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:database-migration-safety",
          "workflow:script",
          "automation",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "data_warehouse_schema_script",
      "title": "Data Warehouse Schema Design: Script",
      "description": "[Data Warehouse Schema Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "trigger": "Create a reusable automation for \"Data Warehouse Schema Design\". The task produces star schema / fact table / dimension table / ETL pipeline spec. Handle the failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\". Include a dry-run mode and test with dbt run + dbt test + query profiling with warehouse-native tools.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Data Warehouse Schema Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with star schema / fact table / dimension table / ETL pipeline spec. Guard against: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Test with dbt run + dbt test + query profiling with warehouse-native tools.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:script",
          "automation",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "design_token_system_script",
      "title": "Design Token Systems: Script",
      "description": "[Design Token Systems] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "trigger": "Create a reusable automation for \"Design Token Systems\". The task produces token JSON / CSS custom properties / theme switcher / token documentation. Handle the failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\". Include a dry-run mode and test with style-dictionary build + Storybook token viewer + token value comparison.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Design Token Systems. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with token JSON / CSS custom properties / theme switcher / token documentation. Guard against: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Test with style-dictionary build + Storybook token viewer + token value comparison.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:design-token-system",
          "workflow:script",
          "automation",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_compose_networking_script",
      "title": "Docker Compose Networking: Script",
      "description": "[Docker Compose Networking] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "trigger": "Create a reusable automation for \"Docker Compose Networking\". The task produces docker-compose.yml / network config / healthcheck / depends_on condition. Handle the failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\". Include a dry-run mode and test with docker compose up --wait + docker network inspect + container logs.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Docker Compose Networking. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with docker-compose.yml / network config / healthcheck / depends_on condition. Guard against: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Test with docker compose up --wait + docker network inspect + container logs.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-compose-networking",
          "workflow:script",
          "automation",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_multistage_script",
      "title": "Docker Multi-Stage Builds: Script",
      "description": "[Docker Multi-Stage Builds] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "trigger": "Create a reusable automation for \"Docker Multi-Stage Builds\". The task produces multi-stage Dockerfile / .dockerignore / slim base image switch. Handle the failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\". Include a dry-run mode and test with docker build + docker scout + dive layer analysis.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Docker Multi-Stage Builds. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with multi-stage Dockerfile / .dockerignore / slim base image switch. Guard against: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Test with docker build + docker scout + dive layer analysis.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-multistage",
          "workflow:script",
          "automation",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "drizzle_schema_design_script",
      "title": "Drizzle Schema Design: Script",
      "description": "[Drizzle Schema Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "trigger": "Create a reusable automation for \"Drizzle Schema Design\". The task produces schema.ts / relation map / migration SQL / Drizzle query builder. Handle the failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\". Include a dry-run mode and test with drizzle-kit push + drizzle-kit studio + generated SQL audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Drizzle Schema Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with schema.ts / relation map / migration SQL / Drizzle query builder. Guard against: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Test with drizzle-kit push + drizzle-kit studio + generated SQL audit.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:script",
          "automation",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "error_monitoring_setup_script",
      "title": "Error Monitoring & Alerting Setup: Script",
      "description": "[Error Monitoring & Alerting Setup] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "trigger": "Create a reusable automation for \"Error Monitoring & Alerting Setup\". The task produces Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Handle the failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\". Include a dry-run mode and test with Sentry API error list + alert rule test + source map validation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Error Monitoring & Alerting Setup. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Guard against: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Test with Sentry API error list + alert rule test + source map validation.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:script",
          "automation",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "fastapi_dependencies_script",
      "title": "FastAPI Dependency Injection: Script",
      "description": "[FastAPI Dependency Injection] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "trigger": "Create a reusable automation for \"FastAPI Dependency Injection\". The task produces dependency / lifespan handler / override for testing. Handle the failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\". Include a dry-run mode and test with uvicorn --reload + /docs interactive test + dependency graph visualisation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific dependency / lifespan handler / override for testing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for FastAPI Dependency Injection. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with dependency / lifespan handler / override for testing. Guard against: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Test with uvicorn --reload + /docs interactive test + dependency graph visualisation.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:script",
          "automation",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "feature_flags_script",
      "title": "Feature Flags & Gradual Rollouts: Script",
      "description": "[Feature Flags & Gradual Rollouts] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "trigger": "Create a reusable automation for \"Feature Flags & Gradual Rollouts\". The task produces flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Handle the failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\". Include a dry-run mode and test with flag evaluation log + rollout percentage monitoring + unused flag scan.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Feature Flags & Gradual Rollouts. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Guard against: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Test with flag evaluation log + rollout percentage monitoring + unused flag scan.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:feature-flags",
          "workflow:script",
          "automation",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "git_conflict_resolution_script",
      "title": "Git Conflict Resolution: Script",
      "description": "[Git Conflict Resolution] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "trigger": "Create a reusable automation for \"Git Conflict Resolution\". The task produces conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Handle the failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\". Include a dry-run mode and test with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Git Conflict Resolution. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Guard against: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Test with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:script",
          "automation",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "github_actions_pipeline_script",
      "title": "GitHub Actions Pipeline Optimisation: Script",
      "description": "[GitHub Actions Pipeline Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "trigger": "Create a reusable automation for \"GitHub Actions Pipeline Optimisation\". The task produces workflow YAML / cache config / matrix build / conditional job execution. Handle the failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\". Include a dry-run mode and test with act --job test + cache hit/miss analysis + workflow graph visualisation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for GitHub Actions Pipeline Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with workflow YAML / cache config / matrix build / conditional job execution. Guard against: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Test with act --job test + cache hit/miss analysis + workflow graph visualisation.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:script",
          "automation",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "graphql_n_plus_one_script",
      "title": "GraphQL N+1 Query Prevention: Script",
      "description": "[GraphQL N+1 Query Prevention] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "trigger": "Create a reusable automation for \"GraphQL N+1 Query Prevention\". The task produces DataLoader instance / batch load function / resolver refactor / query complexity analysis. Handle the failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\". Include a dry-run mode and test with graphql query with tracing + DataLoader statistics + SQL log analysis.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for GraphQL N+1 Query Prevention. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with DataLoader instance / batch load function / resolver refactor / query complexity analysis. Guard against: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Test with graphql query with tracing + DataLoader statistics + SQL log analysis.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:script",
          "automation",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "jest_test_optimization_script",
      "title": "Jest Test Optimisation: Script",
      "description": "[Jest Test Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "trigger": "Create a reusable automation for \"Jest Test Optimisation\". The task produces jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Handle the failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\". Include a dry-run mode and test with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Jest Test Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Guard against: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Test with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:jest-test-optimization",
          "workflow:script",
          "automation",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "json_schema_validation_script",
      "title": "JSON Schema Validation: Script",
      "description": "[JSON Schema Validation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "trigger": "Create a reusable automation for \"JSON Schema Validation\". The task produces JSON Schema / validator middleware / type guard / error message / response parser. Handle the failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\". Include a dry-run mode and test with ajv validate + JSON Schema test suite + response mock test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for JSON Schema Validation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with JSON Schema / validator middleware / type guard / error message / response parser. Guard against: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Test with ajv validate + JSON Schema test suite + response mock test.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:json-schema-validation",
          "workflow:script",
          "automation",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_hpa_script",
      "title": "Kubernetes Horizontal Pod Autoscaling: Script",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "trigger": "Create a reusable automation for \"Kubernetes Horizontal Pod Autoscaling\". The task produces HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Handle the failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\". Include a dry-run mode and test with kubectl get hpa --watch + kubectl top pods + metrics-server logs.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Kubernetes Horizontal Pod Autoscaling. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Guard against: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Test with kubectl get hpa --watch + kubectl top pods + metrics-server logs.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:script",
          "automation",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_pod_lifecycle_script",
      "title": "Kubernetes Pod Lifecycle: Script",
      "description": "[Kubernetes Pod Lifecycle] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "trigger": "Create a reusable automation for \"Kubernetes Pod Lifecycle\". The task produces deployment.yaml / startup probe / readiness probe / liveness probe / init container. Handle the failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\". Include a dry-run mode and test with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Kubernetes Pod Lifecycle. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with deployment.yaml / startup probe / readiness probe / liveness probe / init container. Guard against: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Test with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:script",
          "automation",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "context_window_budget_script",
      "title": "LLM Context Window Budget Management: Script",
      "description": "[LLM Context Window Budget Management] Create a reusable automation with idempotency, dry-run mode, and verification Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "trigger": "Create a reusable automation for \"LLM Context Window Budget Management\". The task produces trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Handle the failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\". Include a dry-run mode and test with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "command",
          "name": "cmd",
          "description": "CMD output"
        }
      ],
      "promptTemplate": "You are automating a workflow for LLM Context Window Budget Management. Create a reusable automation with idempotency, dry-run mode, and verification. The automation should produce or interact with trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Guard against: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Test with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:context-window-budget",
          "workflow:script",
          "automation",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "mcp_tool_design_script",
      "title": "MCP Tool Design & Best Practices: Script",
      "description": "[MCP Tool Design & Best Practices] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "trigger": "Create a reusable automation for \"MCP Tool Design & Best Practices\". The task produces MCP tool descriptor / resource definition / prompt template / server metadata. Handle the failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\". Include a dry-run mode and test with mcp-cli run + mcp inspector + tool name conflict analysis.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for MCP Tool Design & Best Practices. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with MCP tool descriptor / resource definition / prompt template / server metadata. Guard against: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Test with mcp-cli run + mcp inspector + tool name conflict analysis.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:mcp-tool-design",
          "workflow:script",
          "automation",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "message_queues_script",
      "title": "Message Queues & Background Jobs: Script",
      "description": "[Message Queues & Background Jobs] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "trigger": "Create a reusable automation for \"Message Queues & Background Jobs\". The task produces queue producer / worker / dead-letter handler / retry policy. Handle the failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\". Include a dry-run mode and test with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Message Queues & Background Jobs. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with queue producer / worker / dead-letter handler / retry policy. Guard against: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Test with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:message-queues",
          "workflow:script",
          "automation",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "multi_tenant_isolation_script",
      "title": "Multi-Tenant Data Isolation: Script",
      "description": "[Multi-Tenant Data Isolation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "trigger": "Create a reusable automation for \"Multi-Tenant Data Isolation\". The task produces RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Handle the failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\". Include a dry-run mode and test with RLS policy test with two different tenant sessions + data leakage check.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Multi-Tenant Data Isolation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Guard against: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Test with RLS policy test with two different tenant sessions + data leakage check.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:script",
          "automation",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_api_routes_script",
      "title": "Next.js API Routes & Route Handlers: Script",
      "description": "[Next.js API Routes & Route Handlers] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "trigger": "Create a reusable automation for \"Next.js API Routes & Route Handlers\". The task produces route.ts handler / server action / API client wrapper / error boundary. Handle the failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\". Include a dry-run mode and test with curl --verbose + API route error log + status code audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Next.js API Routes & Route Handlers. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with route.ts handler / server action / API client wrapper / error boundary. Guard against: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Test with curl --verbose + API route error log + status code audit.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:script",
          "automation",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_data_fetching_script",
      "title": "Next.js Data Fetching Patterns: Script",
      "description": "[Next.js Data Fetching Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "trigger": "Create a reusable automation for \"Next.js Data Fetching Patterns\". The task produces server fetch / React cache wrapper / streaming suspense boundary. Handle the failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\". Include a dry-run mode and test with next build --debug + React DevTools fetch profiling.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Next.js Data Fetching Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with server fetch / React cache wrapper / streaming suspense boundary. Guard against: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Test with next build --debug + React DevTools fetch profiling.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:script",
          "automation",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_middleware_script",
      "title": "Next.js Middleware & Edge Runtime: Script",
      "description": "[Next.js Middleware & Edge Runtime] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "trigger": "Create a reusable automation for \"Next.js Middleware & Edge Runtime\". The task produces middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Handle the failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\". Include a dry-run mode and test with next dev + curl --cookie tests + edge runtime log inspection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Next.js Middleware & Edge Runtime. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Guard against: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Test with next dev + curl --cookie tests + edge runtime log inspection.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-middleware",
          "workflow:script",
          "automation",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_error_handling_script",
      "title": "Node.js Error Handling & Resilience: Script",
      "description": "[Node.js Error Handling & Resilience] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "trigger": "Create a reusable automation for \"Node.js Error Handling & Resilience\". The task produces global error handler / async wrapper / structured error response / retry logic. Handle the failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\". Include a dry-run mode and test with node --unhandled-rejections=strict + process.on('uncaughtException') log.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Node.js Error Handling & Resilience. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with global error handler / async wrapper / structured error response / retry logic. Guard against: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Test with node --unhandled-rejections=strict + process.on('uncaughtException') log.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-error-handling",
          "workflow:script",
          "automation",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_streams_script",
      "title": "Node.js Streams & Backpressure: Script",
      "description": "[Node.js Streams & Backpressure] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "trigger": "Create a reusable automation for \"Node.js Streams & Backpressure\". The task produces Readable/Writable stream / Transform / pipeline() refactor. Handle the failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\". Include a dry-run mode and test with Node.js --inspect memory heap snapshot + stream highWaterMark tuning.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Node.js Streams & Backpressure. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with Readable/Writable stream / Transform / pipeline() refactor. Guard against: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Test with Node.js --inspect memory heap snapshot + stream highWaterMark tuning.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-streams",
          "workflow:script",
          "automation",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "oauth_flows_script",
      "title": "OAuth 2.0 Flows & Token Management: Script",
      "description": "[OAuth 2.0 Flows & Token Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "trigger": "Create a reusable automation for \"OAuth 2.0 Flows & Token Management\". The task produces OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Handle the failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\". Include a dry-run mode and test with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for OAuth 2.0 Flows & Token Management. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Guard against: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Test with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:oauth-flows",
          "workflow:script",
          "automation",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "openapi_spec_script",
      "title": "OpenAPI Specification & Validation: Script",
      "description": "[OpenAPI Specification & Validation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "trigger": "Create a reusable automation for \"OpenAPI Specification & Validation\". The task produces openapi.yaml / code-first generator / request/response validation middleware. Handle the failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\". Include a dry-run mode and test with redocly lint + openapi-diff + swagger-ui preview.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for OpenAPI Specification & Validation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with openapi.yaml / code-first generator / request/response validation middleware. Guard against: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Test with redocly lint + openapi-diff + swagger-ui preview.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:openapi-spec",
          "workflow:script",
          "automation",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "playwright_selectors_script",
      "title": "Playwright Selectors & Locators: Script",
      "description": "[Playwright Selectors & Locators] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "trigger": "Create a reusable automation for \"Playwright Selectors & Locators\". The task produces locator refactor / test fixture / POM (Page Object Model) / custom fixture. Handle the failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\". Include a dry-run mode and test with playwright test --reporter=html + playwright codegen + trace viewer.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Playwright Selectors & Locators. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with locator refactor / test fixture / POM (Page Object Model) / custom fixture. Guard against: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Test with playwright test --reporter=html + playwright codegen + trace viewer.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:playwright-selectors",
          "workflow:script",
          "automation",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "prompt_injection_defense_script",
      "title": "Prompt Injection Defense: Script",
      "description": "[Prompt Injection Defense] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "trigger": "Create a reusable automation for \"Prompt Injection Defense\". The task produces defensive system prompt / input sanitizer / instruction guardrail / output validator. Handle the failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\". Include a dry-run mode and test with prompt injection test suite + adversarial input fuzzing + output scanner.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Prompt Injection Defense. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with defensive system prompt / input sanitizer / instruction guardrail / output validator. Guard against: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Test with prompt injection test suite + adversarial input fuzzing + output scanner.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:script",
          "automation",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_async_script",
      "title": "Python Async/Await Patterns: Script",
      "description": "[Python Async/Await Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "trigger": "Create a reusable automation for \"Python Async/Await Patterns\". The task produces async/await refactor / asyncio.gather / async context manager. Handle the failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\". Include a dry-run mode and test with python3 -m asyncio + aiohttp/httpx async benchmark.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Python Async/Await Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with async/await refactor / asyncio.gather / async context manager. Guard against: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Test with python3 -m asyncio + aiohttp/httpx async benchmark.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-async",
          "workflow:script",
          "automation",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_file_io_script",
      "title": "Python File I/O & Encoding: Script",
      "description": "[Python File I/O & Encoding] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "trigger": "Create a reusable automation for \"Python File I/O & Encoding\". The task produces pathlib refactor / encoding-safe file reader / batch file processor. Handle the failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\". Include a dry-run mode and test with python3 -c with open() + chardet encoding detection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Python File I/O & Encoding. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with pathlib refactor / encoding-safe file reader / batch file processor. Guard against: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Test with python3 -c with open() + chardet encoding detection.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-file-io",
          "workflow:script",
          "automation",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rag_chunking_script",
      "title": "RAG Chunking Strategies: Script",
      "description": "[RAG Chunking Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "trigger": "Create a reusable automation for \"RAG Chunking Strategies\". The task produces semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Handle the failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\". Include a dry-run mode and test with retrieval evaluation script + chunk boundary visualisation + recall@k measurement.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for RAG Chunking Strategies. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Guard against: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Test with retrieval evaluation script + chunk boundary visualisation + recall@k measurement.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rag-chunking",
          "workflow:script",
          "automation",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rate_limiting_proxy_script",
      "title": "Rate Limiting & API Gateway Proxy: Script",
      "description": "[Rate Limiting & API Gateway Proxy] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "trigger": "Create a reusable automation for \"Rate Limiting & API Gateway Proxy\". The task produces NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Handle the failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\". Include a dry-run mode and test with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Rate Limiting & API Gateway Proxy. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Guard against: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Test with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:script",
          "automation",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_server_components_script",
      "title": "React Server Components: Script",
      "description": "[React Server Components] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "trigger": "Create a reusable automation for \"React Server Components\". The task produces server component / client boundary refactor / streaming fallback. Handle the failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\". Include a dry-run mode and test with next build --debug + React Server Components lint rule.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for React Server Components. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with server component / client boundary refactor / streaming fallback. Guard against: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Test with next build --debug + React Server Components lint rule.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-server-components",
          "workflow:script",
          "automation",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_state_script",
      "title": "React State Management: Script",
      "description": "[React State Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "trigger": "Create a reusable automation for \"React State Management\". The task produces useState / useReducer / useContext hook refactor, zustand or jotai store slice. Handle the failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\". Include a dry-run mode and test with React DevTools profiler + why-did-you-render.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for React State Management. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with useState / useReducer / useContext hook refactor, zustand or jotai store slice. Guard against: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Test with React DevTools profiler + why-did-you-render.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-state",
          "workflow:script",
          "automation",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "redis_caching_script",
      "title": "Redis Caching Strategies: Script",
      "description": "[Redis Caching Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "trigger": "Create a reusable automation for \"Redis Caching Strategies\". The task produces cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Handle the failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\". Include a dry-run mode and test with redis-cli --stat + cache hit ratio monitoring + slow log.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Redis Caching Strategies. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Guard against: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Test with redis-cli --stat + cache hit ratio monitoring + slow log.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:redis-caching",
          "workflow:script",
          "automation",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rest_pagination_script",
      "title": "REST Pagination Design: Script",
      "description": "[REST Pagination Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "trigger": "Create a reusable automation for \"REST Pagination Design\". The task produces cursor pagination / offset pagination fallback / total count optimisation / response envelope. Handle the failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\". Include a dry-run mode and test with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for REST Pagination Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with cursor pagination / offset pagination fallback / total count optimisation / response envelope. Guard against: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Test with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rest-pagination",
          "workflow:script",
          "automation",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "secrets_rotation_script",
      "title": "Secrets Rotation Policy: Script",
      "description": "[Secrets Rotation Policy] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "trigger": "Create a reusable automation for \"Secrets Rotation Policy\". The task produces rotation script / vault integration / lease management / incident response plan. Handle the failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\". Include a dry-run mode and test with vault lease list + secret expiry check + rotation dry-run test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Secrets Rotation Policy. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with rotation script / vault integration / lease management / incident response plan. Guard against: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Test with vault lease list + secret expiry check + rotation dry-run test.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:secrets-rotation",
          "workflow:script",
          "automation",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "shell_script_robustness_script",
      "title": "Shell Script Robustness & Safety: Script",
      "description": "[Shell Script Robustness & Safety] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "trigger": "Create a reusable automation for \"Shell Script Robustness & Safety\". The task produces set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Handle the failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\". Include a dry-run mode and test with shellcheck script.sh + bash -n script.sh + dry-run mode test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Shell Script Robustness & Safety. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Guard against: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Test with shellcheck script.sh + bash -n script.sh + dry-run mode test.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:shell-script-robustness",
          "workflow:script",
          "automation",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "sql_query_optimization_script",
      "title": "SQL Query Optimisation: Script",
      "description": "[SQL Query Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "trigger": "Create a reusable automation for \"SQL Query Optimisation\". The task produces indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Handle the failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\". Include a dry-run mode and test with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for SQL Query Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Guard against: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Test with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:sql-query-optimization",
          "workflow:script",
          "automation",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stealth_web_research_script",
      "title": "Stealth Web Research & Harvesting: Script",
      "description": "[Stealth Web Research & Harvesting] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "trigger": "Create a reusable automation for \"Stealth Web Research & Harvesting\". The task produces clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Handle the failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\". Include a dry-run mode and test with playwright-extra + stealth + cheerio + defuddle + manual jq inspection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Stealth Web Research & Harvesting. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Guard against: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Test with playwright-extra + stealth + cheerio + defuddle + manual jq inspection.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stealth-web-research",
          "workflow:script",
          "automation",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stripe_webhook_idempotency_script",
      "title": "Stripe Webhook Idempotency: Script",
      "description": "[Stripe Webhook Idempotency] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "trigger": "Create a reusable automation for \"Stripe Webhook Idempotency\". The task produces Webhook handler / idempotency key check / event deduplication / failed payment recovery. Handle the failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\". Include a dry-run mode and test with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Stripe Webhook Idempotency. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with Webhook handler / idempotency key check / event deduplication / failed payment recovery. Guard against: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Test with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:script",
          "automation",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "supabase_rls_script",
      "title": "Supabase Row-Level Security: Script",
      "description": "[Supabase Row-Level Security] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "trigger": "Create a reusable automation for \"Supabase Row-Level Security\". The task produces RLS policy / policy test / security definer function / admin bypass. Handle the failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\". Include a dry-run mode and test with supabase db check + supabase db test + RLS policy review with pg_policies.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Supabase Row-Level Security. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with RLS policy / policy test / security definer function / admin bypass. Guard against: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Test with supabase db check + supabase db test + RLS policy review with pg_policies.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:supabase-rls",
          "workflow:script",
          "automation",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "terraform_state_script",
      "title": "Terraform State Management: Script",
      "description": "[Terraform State Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "trigger": "Create a reusable automation for \"Terraform State Management\". The task produces backend config / state migration plan / state locking config / remote state datasource. Handle the failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\". Include a dry-run mode and test with terraform plan + terraform state list + terraform state pull | jq.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Terraform State Management. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with backend config / state migration plan / state locking config / remote state datasource. Guard against: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Test with terraform plan + terraform state list + terraform state pull | jq.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:terraform-state",
          "workflow:script",
          "automation",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "typescript_generics_script",
      "title": "TypeScript Generics & Advanced Types: Script",
      "description": "[TypeScript Generics & Advanced Types] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "trigger": "Create a reusable automation for \"TypeScript Generics & Advanced Types\". The task produces generic type / conditional type / mapped type / branded type. Handle the failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\". Include a dry-run mode and test with tsc --noEmit --strict + type tests with expect-type.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for TypeScript Generics & Advanced Types. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with generic type / conditional type / mapped type / branded type. Guard against: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Test with tsc --noEmit --strict + type tests with expect-type.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:typescript-generics",
          "workflow:script",
          "automation",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "user_onboarding_flow_script",
      "title": "User Onboarding Flow Design: Script",
      "description": "[User Onboarding Flow Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "trigger": "Create a reusable automation for \"User Onboarding Flow Design\". The task produces onboarding wizard / feature checklist / in-app guide / first-run experience spec. Handle the failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\". Include a dry-run mode and test with analytics funnel analysis + onboarding completion rate + drop-off heatmap.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for User Onboarding Flow Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with onboarding wizard / feature checklist / in-app guide / first-run experience spec. Guard against: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Test with analytics funnel analysis + onboarding completion rate + drop-off heatmap.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:script",
          "automation",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "vercel_env_vars_script",
      "title": "Vercel Environment Variables: Script",
      "description": "[Vercel Environment Variables] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "trigger": "Create a reusable automation for \"Vercel Environment Variables\". The task produces vercel.json env group / preview env config / Edge Config / KV store. Handle the failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\". Include a dry-run mode and test with vercel env pull + vercel list + project settings audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Vercel Environment Variables. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with vercel.json env group / preview env config / Edge Config / KV store. Guard against: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Test with vercel env pull + vercel list + project settings audit.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:vercel-env-vars",
          "workflow:script",
          "automation",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_scraping_ethics_script",
      "title": "Web Scraping Ethics & Compliance: Script",
      "description": "[Web Scraping Ethics & Compliance] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "trigger": "Create a reusable automation for \"Web Scraping Ethics & Compliance\". The task produces robots.txt check / polite scraper / rate-limited crawler / cached scraper. Handle the failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\". Include a dry-run mode and test with curl robots.txt + wget --wait + scraper log audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Web Scraping Ethics & Compliance. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with robots.txt check / polite scraper / rate-limited crawler / cached scraper. Guard against: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Test with curl robots.txt + wget --wait + scraper log audit.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:script",
          "automation",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "websocket_reconnection_script",
      "title": "WebSocket Reconnection Strategies: Script",
      "description": "[WebSocket Reconnection Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "trigger": "Create a reusable automation for \"WebSocket Reconnection Strategies\". The task produces WebSocket client / reconnection logic / heartbeat / connection status component. Handle the failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\". Include a dry-run mode and test with Browser DevTools Network tab WS filter + reconnection test with server restart.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for WebSocket Reconnection Strategies. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with WebSocket client / reconnection logic / heartbeat / connection status component. Guard against: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Test with Browser DevTools Network tab WS filter + reconnection test with server restart.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:websocket-reconnection",
          "workflow:script",
          "automation",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_vitals_optimization_script",
      "title": "Web Vitals Optimisation (LCP/CLS/INP): Script",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "trigger": "Create a reusable automation for \"Web Vitals Optimisation (LCP/CLS/INP)\". The task produces image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Handle the failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\". Include a dry-run mode and test with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are automating a workflow for Web Vitals Optimisation (LCP/CLS/INP). Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Guard against: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Test with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:script",
          "automation",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "memory_compressor",
      "title": "Memory Compressor",
      "description": "Condenses a long agent session or conversation into a compact, lossless summary that preserves all decisions, code changes, risks, and next steps. Designed for handover between agents or sessions.",
      "trigger": "Call this when a session is becoming too long for the context window, when handing off to another agent, or when the user asks for a session summary.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "transcript": {
            "type": "string",
            "description": "The full conversation or session log to compress."
          }
        },
        "required": [
          "goal",
          "transcript"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        }
      ],
      "promptTemplate": "Scan the conversation chronologically. Extract: (1) decisions made and their rationale, (2) files created or modified (with diff summary), (3) open risks or unresolved questions, (4) verification commands run and their results, (5) explicit next steps. Format as a structured markdown document with headings. Omit chitchat, speculation, and redundant exploration. Preserve all exact file paths, function names, and command invocations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "memory",
          "compression",
          "handoff"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a_b_testing_framework_diagnose",
      "title": "A/B Testing Framework: Diagnose",
      "description": "[A/B Testing Framework] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "trigger": "Diagnose a problem in \"A/B Testing Framework\". The failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\" is a likely candidate. Isolate the root cause with minimal experiments. Use statsmodels sample size calculation + Bayesian A/B test + sequential testing for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in A/B Testing Framework. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Use statsmodels sample size calculation + Bayesian A/B test + sequential testing to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:diagnose",
          "diagnostics",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a11y_aria_patterns_diagnose",
      "title": "Accessibility ARIA Patterns: Diagnose",
      "description": "[Accessibility ARIA Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "trigger": "Diagnose a problem in \"Accessibility ARIA Patterns\". The failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\" is a likely candidate. Isolate the root cause with minimal experiments. Use axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Accessibility ARIA Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Use axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:diagnose",
          "diagnostics",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "agent_tool_binding_diagnose",
      "title": "Agent Tool Binding & Dispatch: Diagnose",
      "description": "[Agent Tool Binding & Dispatch] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "trigger": "Diagnose a problem in \"Agent Tool Binding & Dispatch\". The failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\" is a likely candidate. Isolate the root cause with minimal experiments. Use agent trace log + tool invocation frequency analysis + token cost audit for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Agent Tool Binding & Dispatch. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Use agent trace log + tool invocation frequency analysis + token cost audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:agent-tool-binding",
          "workflow:diagnose",
          "diagnostics",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "analytics_metric_definition_diagnose",
      "title": "Analytics Metric Definitions: Diagnose",
      "description": "[Analytics Metric Definitions] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "trigger": "Diagnose a problem in \"Analytics Metric Definitions\". The failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\" is a likely candidate. Isolate the root cause with minimal experiments. Use dbt docs generate + dbt test --select tag:metrics + metric comparison script for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Analytics Metric Definitions. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Use dbt docs generate + dbt test --select tag:metrics + metric comparison script to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:diagnose",
          "diagnostics",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "adr_documentation_diagnose",
      "title": "Architecture Decision Records: Diagnose",
      "description": "[Architecture Decision Records] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "trigger": "Diagnose a problem in \"Architecture Decision Records\". The failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\" is a likely candidate. Isolate the root cause with minimal experiments. Use adr-tools list + adr-tools generate + decision log index page for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ADR document / decision log / template / review workflow this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Architecture Decision Records. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Use adr-tools list + adr-tools generate + decision log index page to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:adr-documentation",
          "workflow:diagnose",
          "diagnostics",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "aws_lambda_cold_start_diagnose",
      "title": "AWS Lambda Cold Starts: Diagnose",
      "description": "[AWS Lambda Cold Starts] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "trigger": "Diagnose a problem in \"AWS Lambda Cold Starts\". The failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\" is a likely candidate. Isolate the root cause with minimal experiments. Use AWS X-Ray trace + Lambda Insights + cold start dashboard for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in AWS Lambda Cold Starts. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Use AWS X-Ray trace + Lambda Insights + cold start dashboard to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:diagnose",
          "diagnostics",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "azure_bicep_diagnose",
      "title": "Azure Bicep Infrastructure: Diagnose",
      "description": "[Azure Bicep Infrastructure] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "trigger": "Diagnose a problem in \"Azure Bicep Infrastructure\". The failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\" is a likely candidate. Isolate the root cause with minimal experiments. Use az deployment group validate + az what-if + bicep build for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific main.bicep / module / parameter file / azd template this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Azure Bicep Infrastructure. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Use az deployment group validate + az what-if + bicep build to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:azure-bicep",
          "workflow:diagnose",
          "diagnostics",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "browser_devtools_diagnose",
      "title": "Browser DevTools & Debugging: Diagnose",
      "description": "[Browser DevTools & Debugging] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "trigger": "Diagnose a problem in \"Browser DevTools & Debugging\". The failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Chrome DevTools performance recording + memory heap snapshot + network throttle for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Browser DevTools & Debugging. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Use Chrome DevTools performance recording + memory heap snapshot + network throttle to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:browser-devtools",
          "workflow:diagnose",
          "diagnostics",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cli_tool_design_diagnose",
      "title": "CLI Tool Design Patterns: Diagnose",
      "description": "[CLI Tool Design Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "trigger": "Diagnose a problem in \"CLI Tool Design Patterns\". The failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\" is a likely candidate. Isolate the root cause with minimal experiments. Use echo $? after CLI run + stderr redirection test + --json output validation for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in CLI Tool Design Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Use echo $? after CLI run + stderr redirection test + --json output validation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cli-tool-design",
          "workflow:diagnose",
          "diagnostics",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cloud_cost_optimization_diagnose",
      "title": "Cloud Cost Optimisation: Diagnose",
      "description": "[Cloud Cost Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "trigger": "Diagnose a problem in \"Cloud Cost Optimisation\". The failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\" is a likely candidate. Isolate the root cause with minimal experiments. Use cloud cost explorer + instance utilisation report + auto-stop Lambda function test for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Cloud Cost Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Use cloud cost explorer + instance utilisation report + auto-stop Lambda function test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:diagnose",
          "diagnostics",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "code_review_checklist_diagnose",
      "title": "Code Review Checklist: Diagnose",
      "description": "[Code Review Checklist] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "trigger": "Diagnose a problem in \"Code Review Checklist\". The failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\" is a likely candidate. Isolate the root cause with minimal experiments. Use git diff --stat + lint-staged + danger.js automated review + commitlint for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Code Review Checklist. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Use git diff --stat + lint-staged + danger.js automated review + commitlint to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:code-review-checklist",
          "workflow:diagnose",
          "diagnostics",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "convex_functions_diagnose",
      "title": "Convex Functions & Mutations: Diagnose",
      "description": "[Convex Functions & Mutations] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "trigger": "Diagnose a problem in \"Convex Functions & Mutations\". The failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\" is a likely candidate. Isolate the root cause with minimal experiments. Use npx convex dev + dashboard OCC conflict log + custom retry logic for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific mutation / query / action / component / scheduler job this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Convex Functions & Mutations. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Use npx convex dev + dashboard OCC conflict log + custom retry logic to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:convex-functions",
          "workflow:diagnose",
          "diagnostics",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cron_job_reliability_diagnose",
      "title": "Cron Job & Scheduled Task Reliability: Diagnose",
      "description": "[Cron Job & Scheduled Task Reliability] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "trigger": "Diagnose a problem in \"Cron Job & Scheduled Task Reliability\". The failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\" is a likely candidate. Isolate the root cause with minimal experiments. Use tail -f /var/log/cron + systemctl status cron + idempotency test script for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Cron Job & Scheduled Task Reliability. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Use tail -f /var/log/cron + systemctl status cron + idempotency test script to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cron-job-reliability",
          "workflow:diagnose",
          "diagnostics",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "css_layout_diagnose",
      "title": "CSS Layout & Responsiveness: Diagnose",
      "description": "[CSS Layout & Responsiveness] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "trigger": "Diagnose a problem in \"CSS Layout & Responsiveness\". The failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Lighthouse mobile emulation + browser DevTools responsive mode for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in CSS Layout & Responsiveness. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Use Lighthouse mobile emulation + browser DevTools responsive mode to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:css-layout",
          "workflow:diagnose",
          "diagnostics",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "csv_data_cleaning_diagnose",
      "title": "CSV Data Cleaning Pipeline: Diagnose",
      "description": "[CSV Data Cleaning Pipeline] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "trigger": "Diagnose a problem in \"CSV Data Cleaning Pipeline\". The failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\" is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -c csv.DictReader + validation script + row count diff for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in CSV Data Cleaning Pipeline. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Use python3 -c csv.DictReader + validation script + row count diff to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:diagnose",
          "diagnostics",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "database_migration_safety_diagnose",
      "title": "Database Migration Safety: Diagnose",
      "description": "[Database Migration Safety] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "trigger": "Diagnose a problem in \"Database Migration Safety\". The failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\" is a likely candidate. Isolate the root cause with minimal experiments. Use pg_locks monitoring during migration + batch backfill script + rollback test for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Database Migration Safety. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Use pg_locks monitoring during migration + batch backfill script + rollback test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:database-migration-safety",
          "workflow:diagnose",
          "diagnostics",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "data_warehouse_schema_diagnose",
      "title": "Data Warehouse Schema Design: Diagnose",
      "description": "[Data Warehouse Schema Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "trigger": "Diagnose a problem in \"Data Warehouse Schema Design\". The failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\" is a likely candidate. Isolate the root cause with minimal experiments. Use dbt run + dbt test + query profiling with warehouse-native tools for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Data Warehouse Schema Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Use dbt run + dbt test + query profiling with warehouse-native tools to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:diagnose",
          "diagnostics",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "design_token_system_diagnose",
      "title": "Design Token Systems: Diagnose",
      "description": "[Design Token Systems] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "trigger": "Diagnose a problem in \"Design Token Systems\". The failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\" is a likely candidate. Isolate the root cause with minimal experiments. Use style-dictionary build + Storybook token viewer + token value comparison for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Design Token Systems. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Use style-dictionary build + Storybook token viewer + token value comparison to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:design-token-system",
          "workflow:diagnose",
          "diagnostics",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_compose_networking_diagnose",
      "title": "Docker Compose Networking: Diagnose",
      "description": "[Docker Compose Networking] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "trigger": "Diagnose a problem in \"Docker Compose Networking\". The failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\" is a likely candidate. Isolate the root cause with minimal experiments. Use docker compose up --wait + docker network inspect + container logs for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Docker Compose Networking. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Use docker compose up --wait + docker network inspect + container logs to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-compose-networking",
          "workflow:diagnose",
          "diagnostics",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_multistage_diagnose",
      "title": "Docker Multi-Stage Builds: Diagnose",
      "description": "[Docker Multi-Stage Builds] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "trigger": "Diagnose a problem in \"Docker Multi-Stage Builds\". The failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\" is a likely candidate. Isolate the root cause with minimal experiments. Use docker build + docker scout + dive layer analysis for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Docker Multi-Stage Builds. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Use docker build + docker scout + dive layer analysis to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-multistage",
          "workflow:diagnose",
          "diagnostics",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "drizzle_schema_design_diagnose",
      "title": "Drizzle Schema Design: Diagnose",
      "description": "[Drizzle Schema Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "trigger": "Diagnose a problem in \"Drizzle Schema Design\". The failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\" is a likely candidate. Isolate the root cause with minimal experiments. Use drizzle-kit push + drizzle-kit studio + generated SQL audit for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Drizzle Schema Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Use drizzle-kit push + drizzle-kit studio + generated SQL audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:diagnose",
          "diagnostics",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "error_monitoring_setup_diagnose",
      "title": "Error Monitoring & Alerting Setup: Diagnose",
      "description": "[Error Monitoring & Alerting Setup] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "trigger": "Diagnose a problem in \"Error Monitoring & Alerting Setup\". The failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Sentry API error list + alert rule test + source map validation for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Error Monitoring & Alerting Setup. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Use Sentry API error list + alert rule test + source map validation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:diagnose",
          "diagnostics",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "fastapi_dependencies_diagnose",
      "title": "FastAPI Dependency Injection: Diagnose",
      "description": "[FastAPI Dependency Injection] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "trigger": "Diagnose a problem in \"FastAPI Dependency Injection\". The failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\" is a likely candidate. Isolate the root cause with minimal experiments. Use uvicorn --reload + /docs interactive test + dependency graph visualisation for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific dependency / lifespan handler / override for testing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in FastAPI Dependency Injection. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Use uvicorn --reload + /docs interactive test + dependency graph visualisation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:diagnose",
          "diagnostics",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "feature_flags_diagnose",
      "title": "Feature Flags & Gradual Rollouts: Diagnose",
      "description": "[Feature Flags & Gradual Rollouts] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "trigger": "Diagnose a problem in \"Feature Flags & Gradual Rollouts\". The failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\" is a likely candidate. Isolate the root cause with minimal experiments. Use flag evaluation log + rollout percentage monitoring + unused flag scan for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Feature Flags & Gradual Rollouts. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Use flag evaluation log + rollout percentage monitoring + unused flag scan to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:feature-flags",
          "workflow:diagnose",
          "diagnostics",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "git_conflict_resolution_diagnose",
      "title": "Git Conflict Resolution: Diagnose",
      "description": "[Git Conflict Resolution] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "trigger": "Diagnose a problem in \"Git Conflict Resolution\". The failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\" is a likely candidate. Isolate the root cause with minimal experiments. Use git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Git Conflict Resolution. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Use git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:diagnose",
          "diagnostics",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "github_actions_pipeline_diagnose",
      "title": "GitHub Actions Pipeline Optimisation: Diagnose",
      "description": "[GitHub Actions Pipeline Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "trigger": "Diagnose a problem in \"GitHub Actions Pipeline Optimisation\". The failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\" is a likely candidate. Isolate the root cause with minimal experiments. Use act --job test + cache hit/miss analysis + workflow graph visualisation for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in GitHub Actions Pipeline Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Use act --job test + cache hit/miss analysis + workflow graph visualisation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:diagnose",
          "diagnostics",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "graphql_n_plus_one_diagnose",
      "title": "GraphQL N+1 Query Prevention: Diagnose",
      "description": "[GraphQL N+1 Query Prevention] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "trigger": "Diagnose a problem in \"GraphQL N+1 Query Prevention\". The failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\" is a likely candidate. Isolate the root cause with minimal experiments. Use graphql query with tracing + DataLoader statistics + SQL log analysis for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in GraphQL N+1 Query Prevention. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Use graphql query with tracing + DataLoader statistics + SQL log analysis to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:diagnose",
          "diagnostics",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "jest_test_optimization_diagnose",
      "title": "Jest Test Optimisation: Diagnose",
      "description": "[Jest Test Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "trigger": "Diagnose a problem in \"Jest Test Optimisation\". The failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\" is a likely candidate. Isolate the root cause with minimal experiments. Use jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Jest Test Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Use jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:jest-test-optimization",
          "workflow:diagnose",
          "diagnostics",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "json_schema_validation_diagnose",
      "title": "JSON Schema Validation: Diagnose",
      "description": "[JSON Schema Validation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "trigger": "Diagnose a problem in \"JSON Schema Validation\". The failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\" is a likely candidate. Isolate the root cause with minimal experiments. Use ajv validate + JSON Schema test suite + response mock test for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in JSON Schema Validation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Use ajv validate + JSON Schema test suite + response mock test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:json-schema-validation",
          "workflow:diagnose",
          "diagnostics",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_hpa_diagnose",
      "title": "Kubernetes Horizontal Pod Autoscaling: Diagnose",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "trigger": "Diagnose a problem in \"Kubernetes Horizontal Pod Autoscaling\". The failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\" is a likely candidate. Isolate the root cause with minimal experiments. Use kubectl get hpa --watch + kubectl top pods + metrics-server logs for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Kubernetes Horizontal Pod Autoscaling. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Use kubectl get hpa --watch + kubectl top pods + metrics-server logs to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:diagnose",
          "diagnostics",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_pod_lifecycle_diagnose",
      "title": "Kubernetes Pod Lifecycle: Diagnose",
      "description": "[Kubernetes Pod Lifecycle] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "trigger": "Diagnose a problem in \"Kubernetes Pod Lifecycle\". The failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\" is a likely candidate. Isolate the root cause with minimal experiments. Use kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Kubernetes Pod Lifecycle. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Use kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:diagnose",
          "diagnostics",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "context_window_budget_diagnose",
      "title": "LLM Context Window Budget Management: Diagnose",
      "description": "[LLM Context Window Budget Management] Isolate root cause with minimal hypotheses and single-variable experiments Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "trigger": "Diagnose a problem in \"LLM Context Window Budget Management\". The failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\" is a likely candidate. Isolate the root cause with minimal experiments. Use tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "command",
          "name": "cmd",
          "description": "CMD output"
        }
      ],
      "promptTemplate": "You are diagnosing a failure in LLM Context Window Budget Management. Isolate root cause with minimal hypotheses and single-variable experiments. The suspected failure pattern is: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Use tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:context-window-budget",
          "workflow:diagnose",
          "diagnostics",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "mcp_tool_design_diagnose",
      "title": "MCP Tool Design & Best Practices: Diagnose",
      "description": "[MCP Tool Design & Best Practices] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "trigger": "Diagnose a problem in \"MCP Tool Design & Best Practices\". The failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\" is a likely candidate. Isolate the root cause with minimal experiments. Use mcp-cli run + mcp inspector + tool name conflict analysis for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in MCP Tool Design & Best Practices. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Use mcp-cli run + mcp inspector + tool name conflict analysis to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:mcp-tool-design",
          "workflow:diagnose",
          "diagnostics",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "message_queues_diagnose",
      "title": "Message Queues & Background Jobs: Diagnose",
      "description": "[Message Queues & Background Jobs] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "trigger": "Diagnose a problem in \"Message Queues & Background Jobs\". The failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Message Queues & Background Jobs. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Use Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:message-queues",
          "workflow:diagnose",
          "diagnostics",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "multi_tenant_isolation_diagnose",
      "title": "Multi-Tenant Data Isolation: Diagnose",
      "description": "[Multi-Tenant Data Isolation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "trigger": "Diagnose a problem in \"Multi-Tenant Data Isolation\". The failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\" is a likely candidate. Isolate the root cause with minimal experiments. Use RLS policy test with two different tenant sessions + data leakage check for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Multi-Tenant Data Isolation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Use RLS policy test with two different tenant sessions + data leakage check to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:diagnose",
          "diagnostics",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_api_routes_diagnose",
      "title": "Next.js API Routes & Route Handlers: Diagnose",
      "description": "[Next.js API Routes & Route Handlers] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "trigger": "Diagnose a problem in \"Next.js API Routes & Route Handlers\". The failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\" is a likely candidate. Isolate the root cause with minimal experiments. Use curl --verbose + API route error log + status code audit for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Next.js API Routes & Route Handlers. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Use curl --verbose + API route error log + status code audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:diagnose",
          "diagnostics",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_data_fetching_diagnose",
      "title": "Next.js Data Fetching Patterns: Diagnose",
      "description": "[Next.js Data Fetching Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "trigger": "Diagnose a problem in \"Next.js Data Fetching Patterns\". The failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\" is a likely candidate. Isolate the root cause with minimal experiments. Use next build --debug + React DevTools fetch profiling for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Next.js Data Fetching Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Use next build --debug + React DevTools fetch profiling to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:diagnose",
          "diagnostics",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_middleware_diagnose",
      "title": "Next.js Middleware & Edge Runtime: Diagnose",
      "description": "[Next.js Middleware & Edge Runtime] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "trigger": "Diagnose a problem in \"Next.js Middleware & Edge Runtime\". The failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\" is a likely candidate. Isolate the root cause with minimal experiments. Use next dev + curl --cookie tests + edge runtime log inspection for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Next.js Middleware & Edge Runtime. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Use next dev + curl --cookie tests + edge runtime log inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-middleware",
          "workflow:diagnose",
          "diagnostics",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_error_handling_diagnose",
      "title": "Node.js Error Handling & Resilience: Diagnose",
      "description": "[Node.js Error Handling & Resilience] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "trigger": "Diagnose a problem in \"Node.js Error Handling & Resilience\". The failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\" is a likely candidate. Isolate the root cause with minimal experiments. Use node --unhandled-rejections=strict + process.on('uncaughtException') log for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Node.js Error Handling & Resilience. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Use node --unhandled-rejections=strict + process.on('uncaughtException') log to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-error-handling",
          "workflow:diagnose",
          "diagnostics",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_streams_diagnose",
      "title": "Node.js Streams & Backpressure: Diagnose",
      "description": "[Node.js Streams & Backpressure] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "trigger": "Diagnose a problem in \"Node.js Streams & Backpressure\". The failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Node.js --inspect memory heap snapshot + stream highWaterMark tuning for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Node.js Streams & Backpressure. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Use Node.js --inspect memory heap snapshot + stream highWaterMark tuning to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-streams",
          "workflow:diagnose",
          "diagnostics",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "oauth_flows_diagnose",
      "title": "OAuth 2.0 Flows & Token Management: Diagnose",
      "description": "[OAuth 2.0 Flows & Token Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "trigger": "Diagnose a problem in \"OAuth 2.0 Flows & Token Management\". The failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\" is a likely candidate. Isolate the root cause with minimal experiments. Use oauth2_proxy + jwt.io debugger + curl --cookie with token inspection for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in OAuth 2.0 Flows & Token Management. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Use oauth2_proxy + jwt.io debugger + curl --cookie with token inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:oauth-flows",
          "workflow:diagnose",
          "diagnostics",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "openapi_spec_diagnose",
      "title": "OpenAPI Specification & Validation: Diagnose",
      "description": "[OpenAPI Specification & Validation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "trigger": "Diagnose a problem in \"OpenAPI Specification & Validation\". The failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\" is a likely candidate. Isolate the root cause with minimal experiments. Use redocly lint + openapi-diff + swagger-ui preview for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in OpenAPI Specification & Validation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Use redocly lint + openapi-diff + swagger-ui preview to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:openapi-spec",
          "workflow:diagnose",
          "diagnostics",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "playwright_selectors_diagnose",
      "title": "Playwright Selectors & Locators: Diagnose",
      "description": "[Playwright Selectors & Locators] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "trigger": "Diagnose a problem in \"Playwright Selectors & Locators\". The failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\" is a likely candidate. Isolate the root cause with minimal experiments. Use playwright test --reporter=html + playwright codegen + trace viewer for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Playwright Selectors & Locators. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Use playwright test --reporter=html + playwright codegen + trace viewer to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:playwright-selectors",
          "workflow:diagnose",
          "diagnostics",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "prompt_injection_defense_diagnose",
      "title": "Prompt Injection Defense: Diagnose",
      "description": "[Prompt Injection Defense] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "trigger": "Diagnose a problem in \"Prompt Injection Defense\". The failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\" is a likely candidate. Isolate the root cause with minimal experiments. Use prompt injection test suite + adversarial input fuzzing + output scanner for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Prompt Injection Defense. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Use prompt injection test suite + adversarial input fuzzing + output scanner to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:diagnose",
          "diagnostics",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_async_diagnose",
      "title": "Python Async/Await Patterns: Diagnose",
      "description": "[Python Async/Await Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "trigger": "Diagnose a problem in \"Python Async/Await Patterns\". The failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\" is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -m asyncio + aiohttp/httpx async benchmark for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Python Async/Await Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Use python3 -m asyncio + aiohttp/httpx async benchmark to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-async",
          "workflow:diagnose",
          "diagnostics",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_file_io_diagnose",
      "title": "Python File I/O & Encoding: Diagnose",
      "description": "[Python File I/O & Encoding] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "trigger": "Diagnose a problem in \"Python File I/O & Encoding\". The failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\" is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -c with open() + chardet encoding detection for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Python File I/O & Encoding. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Use python3 -c with open() + chardet encoding detection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-file-io",
          "workflow:diagnose",
          "diagnostics",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rag_chunking_diagnose",
      "title": "RAG Chunking Strategies: Diagnose",
      "description": "[RAG Chunking Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "trigger": "Diagnose a problem in \"RAG Chunking Strategies\". The failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\" is a likely candidate. Isolate the root cause with minimal experiments. Use retrieval evaluation script + chunk boundary visualisation + recall@k measurement for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in RAG Chunking Strategies. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Use retrieval evaluation script + chunk boundary visualisation + recall@k measurement to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rag-chunking",
          "workflow:diagnose",
          "diagnostics",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rate_limiting_proxy_diagnose",
      "title": "Rate Limiting & API Gateway Proxy: Diagnose",
      "description": "[Rate Limiting & API Gateway Proxy] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "trigger": "Diagnose a problem in \"Rate Limiting & API Gateway Proxy\". The failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\" is a likely candidate. Isolate the root cause with minimal experiments. Use ab -n 1000 -c 10 + nginx error log + 429 response code monitoring for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Rate Limiting & API Gateway Proxy. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Use ab -n 1000 -c 10 + nginx error log + 429 response code monitoring to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:diagnose",
          "diagnostics",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_server_components_diagnose",
      "title": "React Server Components: Diagnose",
      "description": "[React Server Components] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "trigger": "Diagnose a problem in \"React Server Components\". The failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\" is a likely candidate. Isolate the root cause with minimal experiments. Use next build --debug + React Server Components lint rule for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in React Server Components. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Use next build --debug + React Server Components lint rule to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-server-components",
          "workflow:diagnose",
          "diagnostics",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_state_diagnose",
      "title": "React State Management: Diagnose",
      "description": "[React State Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "trigger": "Diagnose a problem in \"React State Management\". The failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\" is a likely candidate. Isolate the root cause with minimal experiments. Use React DevTools profiler + why-did-you-render for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in React State Management. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Use React DevTools profiler + why-did-you-render to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-state",
          "workflow:diagnose",
          "diagnostics",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "redis_caching_diagnose",
      "title": "Redis Caching Strategies: Diagnose",
      "description": "[Redis Caching Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "trigger": "Diagnose a problem in \"Redis Caching Strategies\". The failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\" is a likely candidate. Isolate the root cause with minimal experiments. Use redis-cli --stat + cache hit ratio monitoring + slow log for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Redis Caching Strategies. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Use redis-cli --stat + cache hit ratio monitoring + slow log to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:redis-caching",
          "workflow:diagnose",
          "diagnostics",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rest_pagination_diagnose",
      "title": "REST Pagination Design: Diagnose",
      "description": "[REST Pagination Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "trigger": "Diagnose a problem in \"REST Pagination Design\". The failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\" is a likely candidate. Isolate the root cause with minimal experiments. Use curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in REST Pagination Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Use curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rest-pagination",
          "workflow:diagnose",
          "diagnostics",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "secrets_rotation_diagnose",
      "title": "Secrets Rotation Policy: Diagnose",
      "description": "[Secrets Rotation Policy] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "trigger": "Diagnose a problem in \"Secrets Rotation Policy\". The failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\" is a likely candidate. Isolate the root cause with minimal experiments. Use vault lease list + secret expiry check + rotation dry-run test for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Secrets Rotation Policy. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Use vault lease list + secret expiry check + rotation dry-run test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:secrets-rotation",
          "workflow:diagnose",
          "diagnostics",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "shell_script_robustness_diagnose",
      "title": "Shell Script Robustness & Safety: Diagnose",
      "description": "[Shell Script Robustness & Safety] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "trigger": "Diagnose a problem in \"Shell Script Robustness & Safety\". The failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\" is a likely candidate. Isolate the root cause with minimal experiments. Use shellcheck script.sh + bash -n script.sh + dry-run mode test for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Shell Script Robustness & Safety. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Use shellcheck script.sh + bash -n script.sh + dry-run mode test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:shell-script-robustness",
          "workflow:diagnose",
          "diagnostics",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "sql_query_optimization_diagnose",
      "title": "SQL Query Optimisation: Diagnose",
      "description": "[SQL Query Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "trigger": "Diagnose a problem in \"SQL Query Optimisation\". The failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\" is a likely candidate. Isolate the root cause with minimal experiments. Use EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in SQL Query Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Use EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:sql-query-optimization",
          "workflow:diagnose",
          "diagnostics",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stealth_web_research_diagnose",
      "title": "Stealth Web Research & Harvesting: Diagnose",
      "description": "[Stealth Web Research & Harvesting] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "trigger": "Diagnose a problem in \"Stealth Web Research & Harvesting\". The failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\" is a likely candidate. Isolate the root cause with minimal experiments. Use playwright-extra + stealth + cheerio + defuddle + manual jq inspection for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Stealth Web Research & Harvesting. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Use playwright-extra + stealth + cheerio + defuddle + manual jq inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stealth-web-research",
          "workflow:diagnose",
          "diagnostics",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stripe_webhook_idempotency_diagnose",
      "title": "Stripe Webhook Idempotency: Diagnose",
      "description": "[Stripe Webhook Idempotency] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "trigger": "Diagnose a problem in \"Stripe Webhook Idempotency\". The failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\" is a likely candidate. Isolate the root cause with minimal experiments. Use stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Stripe Webhook Idempotency. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Use stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:diagnose",
          "diagnostics",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "supabase_rls_diagnose",
      "title": "Supabase Row-Level Security: Diagnose",
      "description": "[Supabase Row-Level Security] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "trigger": "Diagnose a problem in \"Supabase Row-Level Security\". The failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\" is a likely candidate. Isolate the root cause with minimal experiments. Use supabase db check + supabase db test + RLS policy review with pg_policies for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Supabase Row-Level Security. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Use supabase db check + supabase db test + RLS policy review with pg_policies to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:supabase-rls",
          "workflow:diagnose",
          "diagnostics",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "terraform_state_diagnose",
      "title": "Terraform State Management: Diagnose",
      "description": "[Terraform State Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "trigger": "Diagnose a problem in \"Terraform State Management\". The failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\" is a likely candidate. Isolate the root cause with minimal experiments. Use terraform plan + terraform state list + terraform state pull | jq for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Terraform State Management. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Use terraform plan + terraform state list + terraform state pull | jq to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:terraform-state",
          "workflow:diagnose",
          "diagnostics",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "typescript_generics_diagnose",
      "title": "TypeScript Generics & Advanced Types: Diagnose",
      "description": "[TypeScript Generics & Advanced Types] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "trigger": "Diagnose a problem in \"TypeScript Generics & Advanced Types\". The failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\" is a likely candidate. Isolate the root cause with minimal experiments. Use tsc --noEmit --strict + type tests with expect-type for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in TypeScript Generics & Advanced Types. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Use tsc --noEmit --strict + type tests with expect-type to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:typescript-generics",
          "workflow:diagnose",
          "diagnostics",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "user_onboarding_flow_diagnose",
      "title": "User Onboarding Flow Design: Diagnose",
      "description": "[User Onboarding Flow Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "trigger": "Diagnose a problem in \"User Onboarding Flow Design\". The failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\" is a likely candidate. Isolate the root cause with minimal experiments. Use analytics funnel analysis + onboarding completion rate + drop-off heatmap for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in User Onboarding Flow Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Use analytics funnel analysis + onboarding completion rate + drop-off heatmap to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:diagnose",
          "diagnostics",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "vercel_env_vars_diagnose",
      "title": "Vercel Environment Variables: Diagnose",
      "description": "[Vercel Environment Variables] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "trigger": "Diagnose a problem in \"Vercel Environment Variables\". The failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\" is a likely candidate. Isolate the root cause with minimal experiments. Use vercel env pull + vercel list + project settings audit for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Vercel Environment Variables. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Use vercel env pull + vercel list + project settings audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:vercel-env-vars",
          "workflow:diagnose",
          "diagnostics",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_scraping_ethics_diagnose",
      "title": "Web Scraping Ethics & Compliance: Diagnose",
      "description": "[Web Scraping Ethics & Compliance] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "trigger": "Diagnose a problem in \"Web Scraping Ethics & Compliance\". The failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\" is a likely candidate. Isolate the root cause with minimal experiments. Use curl robots.txt + wget --wait + scraper log audit for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Web Scraping Ethics & Compliance. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Use curl robots.txt + wget --wait + scraper log audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:diagnose",
          "diagnostics",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "websocket_reconnection_diagnose",
      "title": "WebSocket Reconnection Strategies: Diagnose",
      "description": "[WebSocket Reconnection Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "trigger": "Diagnose a problem in \"WebSocket Reconnection Strategies\". The failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\" is a likely candidate. Isolate the root cause with minimal experiments. Use Browser DevTools Network tab WS filter + reconnection test with server restart for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in WebSocket Reconnection Strategies. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Use Browser DevTools Network tab WS filter + reconnection test with server restart to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:websocket-reconnection",
          "workflow:diagnose",
          "diagnostics",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_vitals_optimization_diagnose",
      "title": "Web Vitals Optimisation (LCP/CLS/INP): Diagnose",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "trigger": "Diagnose a problem in \"Web Vitals Optimisation (LCP/CLS/INP)\". The failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\" is a likely candidate. Isolate the root cause with minimal experiments. Use Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension for verification.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are diagnosing a failure in Web Vitals Optimisation (LCP/CLS/INP). Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Use Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:diagnose",
          "diagnostics",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a_b_testing_framework_explain",
      "title": "A/B Testing Framework: Explain",
      "description": "[A/B Testing Framework] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "trigger": "Write documentation for \"A/B Testing Framework\". Cover: what it is, when to use it, the Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise. pitfall, and how to verify with statsmodels sample size calculation + Bayesian A/B test + sequential testing. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting A/B Testing Framework. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (experiment spec / variant assignment / metric definition / statistical analysis script), the common failure pattern (Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.), the best practice (Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.), and the verification command (statsmodels sample size calculation + Bayesian A/B test + sequential testing).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:explain",
          "docs",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a11y_aria_patterns_explain",
      "title": "Accessibility ARIA Patterns: Explain",
      "description": "[Accessibility ARIA Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "trigger": "Write documentation for \"Accessibility ARIA Patterns\". Cover: what it is, when to use it, the Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers. pitfall, and how to verify with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Accessibility ARIA Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (ARIA attribute refactor / keyboard navigation / focus management / screen reader test script), the common failure pattern (Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.), the best practice (Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.), and the verification command (axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:explain",
          "docs",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "agent_tool_binding_explain",
      "title": "Agent Tool Binding & Dispatch: Explain",
      "description": "[Agent Tool Binding & Dispatch] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "trigger": "Write documentation for \"Agent Tool Binding & Dispatch\". Cover: what it is, when to use it, the Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly. pitfall, and how to verify with agent trace log + tool invocation frequency analysis + token cost audit. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Agent Tool Binding & Dispatch. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (router tool / domain group / dynamic tool injection / tool usage statistics), the common failure pattern (Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.), the best practice (Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.), and the verification command (agent trace log + tool invocation frequency analysis + token cost audit).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:agent-tool-binding",
          "workflow:explain",
          "docs",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "analytics_metric_definition_explain",
      "title": "Analytics Metric Definitions: Explain",
      "description": "[Analytics Metric Definitions] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "trigger": "Write documentation for \"Analytics Metric Definitions\". Cover: what it is, when to use it, the Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers. pitfall, and how to verify with dbt docs generate + dbt test --select tag:metrics + metric comparison script. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Analytics Metric Definitions. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (metric definition / dbt model / SQL logic / dashboard tile / documentation), the common failure pattern (Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.), the best practice (Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.), and the verification command (dbt docs generate + dbt test --select tag:metrics + metric comparison script).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:explain",
          "docs",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "adr_documentation_explain",
      "title": "Architecture Decision Records: Explain",
      "description": "[Architecture Decision Records] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "trigger": "Write documentation for \"Architecture Decision Records\". Cover: what it is, when to use it, the Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done. pitfall, and how to verify with adr-tools list + adr-tools generate + decision log index page. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ADR document / decision log / template / review workflow this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Architecture Decision Records. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (ADR document / decision log / template / review workflow), the common failure pattern (Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.), the best practice (Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.), and the verification command (adr-tools list + adr-tools generate + decision log index page).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:adr-documentation",
          "workflow:explain",
          "docs",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "aws_lambda_cold_start_explain",
      "title": "AWS Lambda Cold Starts: Explain",
      "description": "[AWS Lambda Cold Starts] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "trigger": "Write documentation for \"AWS Lambda Cold Starts\". Cover: what it is, when to use it, the Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler. pitfall, and how to verify with AWS X-Ray trace + Lambda Insights + cold start dashboard. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting AWS Lambda Cold Starts. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (handler refactor / SnapStart config / Provisioned Concurrency / warmer function), the common failure pattern (Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.), the best practice (Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.), and the verification command (AWS X-Ray trace + Lambda Insights + cold start dashboard).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:explain",
          "docs",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "azure_bicep_explain",
      "title": "Azure Bicep Infrastructure: Explain",
      "description": "[Azure Bicep Infrastructure] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "trigger": "Write documentation for \"Azure Bicep Infrastructure\". Cover: what it is, when to use it, the Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce. pitfall, and how to verify with az deployment group validate + az what-if + bicep build. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific main.bicep / module / parameter file / azd template this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Azure Bicep Infrastructure. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (main.bicep / module / parameter file / azd template), the common failure pattern (Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.), the best practice (Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.), and the verification command (az deployment group validate + az what-if + bicep build).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:azure-bicep",
          "workflow:explain",
          "docs",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "browser_devtools_explain",
      "title": "Browser DevTools & Debugging: Explain",
      "description": "[Browser DevTools & Debugging] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "trigger": "Write documentation for \"Browser DevTools & Debugging\". Cover: what it is, when to use it, the Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically. pitfall, and how to verify with Chrome DevTools performance recording + memory heap snapshot + network throttle. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Browser DevTools & Debugging. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (debugging workflow / breakpoint guide / performance recording / memory snapshot), the common failure pattern (Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.), the best practice (Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.), and the verification command (Chrome DevTools performance recording + memory heap snapshot + network throttle).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:browser-devtools",
          "workflow:explain",
          "docs",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cli_tool_design_explain",
      "title": "CLI Tool Design Patterns: Explain",
      "description": "[CLI Tool Design Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "trigger": "Write documentation for \"CLI Tool Design Patterns\". Cover: what it is, when to use it, the Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with. pitfall, and how to verify with echo $? after CLI run + stderr redirection test + --json output validation. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting CLI Tool Design Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (CLI scaffolding / argument parser / exit code handler / --json output mode), the common failure pattern (Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.), the best practice (Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.), and the verification command (echo $? after CLI run + stderr redirection test + --json output validation).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cli-tool-design",
          "workflow:explain",
          "docs",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cloud_cost_optimization_explain",
      "title": "Cloud Cost Optimisation: Explain",
      "description": "[Cloud Cost Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "trigger": "Write documentation for \"Cloud Cost Optimisation\". Cover: what it is, when to use it, the Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours. pitfall, and how to verify with cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Cloud Cost Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report), the common failure pattern (Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.), the best practice (Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.), and the verification command (cloud cost explorer + instance utilisation report + auto-stop Lambda function test).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:explain",
          "docs",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "code_review_checklist_explain",
      "title": "Code Review Checklist: Explain",
      "description": "[Code Review Checklist] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "trigger": "Write documentation for \"Code Review Checklist\". Cover: what it is, when to use it, the Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions. pitfall, and how to verify with git diff --stat + lint-staged + danger.js automated review + commitlint. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Code Review Checklist. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (review checklist / automated review comment / risk classification / diff summary), the common failure pattern (Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.), the best practice (Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.), and the verification command (git diff --stat + lint-staged + danger.js automated review + commitlint).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:code-review-checklist",
          "workflow:explain",
          "docs",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "convex_functions_explain",
      "title": "Convex Functions & Mutations: Explain",
      "description": "[Convex Functions & Mutations] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "trigger": "Write documentation for \"Convex Functions & Mutations\". Cover: what it is, when to use it, the Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients. pitfall, and how to verify with npx convex dev + dashboard OCC conflict log + custom retry logic. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific mutation / query / action / component / scheduler job this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Convex Functions & Mutations. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (mutation / query / action / component / scheduler job), the common failure pattern (Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.), the best practice (Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.), and the verification command (npx convex dev + dashboard OCC conflict log + custom retry logic).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:convex-functions",
          "workflow:explain",
          "docs",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cron_job_reliability_explain",
      "title": "Cron Job & Scheduled Task Reliability: Explain",
      "description": "[Cron Job & Scheduled Task Reliability] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "trigger": "Write documentation for \"Cron Job & Scheduled Task Reliability\". Cover: what it is, when to use it, the Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time. pitfall, and how to verify with tail -f /var/log/cron + systemctl status cron + idempotency test script. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Cron Job & Scheduled Task Reliability. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (crontab entry / log rotation / idempotency guard / failure alert integration), the common failure pattern (Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.), the best practice (Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.), and the verification command (tail -f /var/log/cron + systemctl status cron + idempotency test script).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cron-job-reliability",
          "workflow:explain",
          "docs",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "css_layout_explain",
      "title": "CSS Layout & Responsiveness: Explain",
      "description": "[CSS Layout & Responsiveness] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "trigger": "Write documentation for \"CSS Layout & Responsiveness\". Cover: what it is, when to use it, the Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable. pitfall, and how to verify with Lighthouse mobile emulation + browser DevTools responsive mode. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting CSS Layout & Responsiveness. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (CSS layout refactor / responsive grid / container query implementation), the common failure pattern (Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.), the best practice (Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.), and the verification command (Lighthouse mobile emulation + browser DevTools responsive mode).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:css-layout",
          "workflow:explain",
          "docs",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "csv_data_cleaning_explain",
      "title": "CSV Data Cleaning Pipeline: Explain",
      "description": "[CSV Data Cleaning Pipeline] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "trigger": "Write documentation for \"CSV Data Cleaning Pipeline\". Cover: what it is, when to use it, the Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines. pitfall, and how to verify with python3 -c csv.DictReader + validation script + row count diff. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting CSV Data Cleaning Pipeline. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (CSV parser / row validator / column type mapper / error report / cleaned output), the common failure pattern (Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.), the best practice (Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.), and the verification command (python3 -c csv.DictReader + validation script + row count diff).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:explain",
          "docs",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "database_migration_safety_explain",
      "title": "Database Migration Safety: Explain",
      "description": "[Database Migration Safety] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "trigger": "Write documentation for \"Database Migration Safety\". Cover: what it is, when to use it, the Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users. pitfall, and how to verify with pg_locks monitoring during migration + batch backfill script + rollback test. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Database Migration Safety. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (batch migration / expand-contract pattern / zero-downtime migration / rollback plan), the common failure pattern (Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.), the best practice (Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.), and the verification command (pg_locks monitoring during migration + batch backfill script + rollback test).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:database-migration-safety",
          "workflow:explain",
          "docs",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "data_warehouse_schema_explain",
      "title": "Data Warehouse Schema Design: Explain",
      "description": "[Data Warehouse Schema Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "trigger": "Write documentation for \"Data Warehouse Schema Design\". Cover: what it is, when to use it, the Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries. pitfall, and how to verify with dbt run + dbt test + query profiling with warehouse-native tools. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Data Warehouse Schema Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (star schema / fact table / dimension table / ETL pipeline spec), the common failure pattern (Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.), the best practice (Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.), and the verification command (dbt run + dbt test + query profiling with warehouse-native tools).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:explain",
          "docs",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "design_token_system_explain",
      "title": "Design Token Systems: Explain",
      "description": "[Design Token Systems] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "trigger": "Write documentation for \"Design Token Systems\". Cover: what it is, when to use it, the Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file. pitfall, and how to verify with style-dictionary build + Storybook token viewer + token value comparison. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Design Token Systems. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (token JSON / CSS custom properties / theme switcher / token documentation), the common failure pattern (Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.), the best practice (Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.), and the verification command (style-dictionary build + Storybook token viewer + token value comparison).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:design-token-system",
          "workflow:explain",
          "docs",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_compose_networking_explain",
      "title": "Docker Compose Networking: Explain",
      "description": "[Docker Compose Networking] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "trigger": "Write documentation for \"Docker Compose Networking\". Cover: what it is, when to use it, the Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name. pitfall, and how to verify with docker compose up --wait + docker network inspect + container logs. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Docker Compose Networking. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (docker-compose.yml / network config / healthcheck / depends_on condition), the common failure pattern (Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.), the best practice (All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.), and the verification command (docker compose up --wait + docker network inspect + container logs).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-compose-networking",
          "workflow:explain",
          "docs",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_multistage_explain",
      "title": "Docker Multi-Stage Builds: Explain",
      "description": "[Docker Multi-Stage Builds] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "trigger": "Write documentation for \"Docker Multi-Stage Builds\". Cover: what it is, when to use it, the Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure. pitfall, and how to verify with docker build + docker scout + dive layer analysis. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Docker Multi-Stage Builds. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (multi-stage Dockerfile / .dockerignore / slim base image switch), the common failure pattern (Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.), the best practice (Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.), and the verification command (docker build + docker scout + dive layer analysis).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-multistage",
          "workflow:explain",
          "docs",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "drizzle_schema_design_explain",
      "title": "Drizzle Schema Design: Explain",
      "description": "[Drizzle Schema Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "trigger": "Write documentation for \"Drizzle Schema Design\". Cover: what it is, when to use it, the Over-using relations() when simple foreign key columns with manual joins would be clearer and faster. pitfall, and how to verify with drizzle-kit push + drizzle-kit studio + generated SQL audit. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Drizzle Schema Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (schema.ts / relation map / migration SQL / Drizzle query builder), the common failure pattern (Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.), the best practice (Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.), and the verification command (drizzle-kit push + drizzle-kit studio + generated SQL audit).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:explain",
          "docs",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "error_monitoring_setup_explain",
      "title": "Error Monitoring & Alerting Setup: Explain",
      "description": "[Error Monitoring & Alerting Setup] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "trigger": "Write documentation for \"Error Monitoring & Alerting Setup\". Cover: what it is, when to use it, the Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains. pitfall, and how to verify with Sentry API error list + alert rule test + source map validation. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Error Monitoring & Alerting Setup. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (Sentry project config / alert rule / error grouping / source map upload / performance monitoring), the common failure pattern (Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.), the best practice (Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).), and the verification command (Sentry API error list + alert rule test + source map validation).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:explain",
          "docs",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "fastapi_dependencies_explain",
      "title": "FastAPI Dependency Injection: Explain",
      "description": "[FastAPI Dependency Injection] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "trigger": "Write documentation for \"FastAPI Dependency Injection\". Cover: what it is, when to use it, the Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection. pitfall, and how to verify with uvicorn --reload + /docs interactive test + dependency graph visualisation. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific dependency / lifespan handler / override for testing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting FastAPI Dependency Injection. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (dependency / lifespan handler / override for testing), the common failure pattern (Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.), the best practice (Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().), and the verification command (uvicorn --reload + /docs interactive test + dependency graph visualisation).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:explain",
          "docs",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "feature_flags_explain",
      "title": "Feature Flags & Gradual Rollouts: Explain",
      "description": "[Feature Flags & Gradual Rollouts] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "trigger": "Write documentation for \"Feature Flags & Gradual Rollouts\". Cover: what it is, when to use it, the Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags. pitfall, and how to verify with flag evaluation log + rollout percentage monitoring + unused flag scan. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Feature Flags & Gradual Rollouts. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (flag provider config / gradual rollout target / flag cleanup plan / A/B test flag), the common failure pattern (Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.), the best practice (Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.), and the verification command (flag evaluation log + rollout percentage monitoring + unused flag scan).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:feature-flags",
          "workflow:explain",
          "docs",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "git_conflict_resolution_explain",
      "title": "Git Conflict Resolution: Explain",
      "description": "[Git Conflict Resolution] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "trigger": "Write documentation for \"Git Conflict Resolution\". Cover: what it is, when to use it, the Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs. pitfall, and how to verify with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Git Conflict Resolution. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message), the common failure pattern (Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.), the best practice (For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.), and the verification command (git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:explain",
          "docs",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "github_actions_pipeline_explain",
      "title": "GitHub Actions Pipeline Optimisation: Explain",
      "description": "[GitHub Actions Pipeline Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "trigger": "Write documentation for \"GitHub Actions Pipeline Optimisation\". Cover: what it is, when to use it, the Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope. pitfall, and how to verify with act --job test + cache hit/miss analysis + workflow graph visualisation. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting GitHub Actions Pipeline Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (workflow YAML / cache config / matrix build / conditional job execution), the common failure pattern (Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.), the best practice (Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.), and the verification command (act --job test + cache hit/miss analysis + workflow graph visualisation).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:explain",
          "docs",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "graphql_n_plus_one_explain",
      "title": "GraphQL N+1 Query Prevention: Explain",
      "description": "[GraphQL N+1 Query Prevention] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "trigger": "Write documentation for \"GraphQL N+1 Query Prevention\". Cover: what it is, when to use it, the A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children. pitfall, and how to verify with graphql query with tracing + DataLoader statistics + SQL log analysis. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting GraphQL N+1 Query Prevention. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (DataLoader instance / batch load function / resolver refactor / query complexity analysis), the common failure pattern (A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.), the best practice (Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.), and the verification command (graphql query with tracing + DataLoader statistics + SQL log analysis).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:explain",
          "docs",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "jest_test_optimization_explain",
      "title": "Jest Test Optimisation: Explain",
      "description": "[Jest Test Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "trigger": "Write documentation for \"Jest Test Optimisation\". Cover: what it is, when to use it, the Running the entire test suite on every change, taking minutes even for small incremental code changes. pitfall, and how to verify with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Jest Test Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking), the common failure pattern (Running the entire test suite on every change, taking minutes even for small incremental code changes.), the best practice (Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.), and the verification command (jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:jest-test-optimization",
          "workflow:explain",
          "docs",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "json_schema_validation_explain",
      "title": "JSON Schema Validation: Explain",
      "description": "[JSON Schema Validation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "trigger": "Write documentation for \"JSON Schema Validation\". Cover: what it is, when to use it, the Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly. pitfall, and how to verify with ajv validate + JSON Schema test suite + response mock test. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting JSON Schema Validation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (JSON Schema / validator middleware / type guard / error message / response parser), the common failure pattern (Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.), the best practice (Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.), and the verification command (ajv validate + JSON Schema test suite + response mock test).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:json-schema-validation",
          "workflow:explain",
          "docs",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_hpa_explain",
      "title": "Kubernetes Horizontal Pod Autoscaling: Explain",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "trigger": "Write documentation for \"Kubernetes Horizontal Pod Autoscaling\". Cover: what it is, when to use it, the HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment. pitfall, and how to verify with kubectl get hpa --watch + kubectl top pods + metrics-server logs. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Kubernetes Horizontal Pod Autoscaling. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config), the common failure pattern (HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.), the best practice (Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.), and the verification command (kubectl get hpa --watch + kubectl top pods + metrics-server logs).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:explain",
          "docs",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_pod_lifecycle_explain",
      "title": "Kubernetes Pod Lifecycle: Explain",
      "description": "[Kubernetes Pod Lifecycle] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "trigger": "Write documentation for \"Kubernetes Pod Lifecycle\". Cover: what it is, when to use it, the Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready. pitfall, and how to verify with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Kubernetes Pod Lifecycle. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (deployment.yaml / startup probe / readiness probe / liveness probe / init container), the common failure pattern (Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.), the best practice (Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.), and the verification command (kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp').",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:explain",
          "docs",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "mcp_tool_design_explain",
      "title": "MCP Tool Design & Best Practices: Explain",
      "description": "[MCP Tool Design & Best Practices] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "trigger": "Write documentation for \"MCP Tool Design & Best Practices\". Cover: what it is, when to use it, the Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent. pitfall, and how to verify with mcp-cli run + mcp inspector + tool name conflict analysis. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting MCP Tool Design & Best Practices. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (MCP tool descriptor / resource definition / prompt template / server metadata), the common failure pattern (Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.), the best practice (Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.), and the verification command (mcp-cli run + mcp inspector + tool name conflict analysis).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:mcp-tool-design",
          "workflow:explain",
          "docs",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "message_queues_explain",
      "title": "Message Queues & Background Jobs: Explain",
      "description": "[Message Queues & Background Jobs] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "trigger": "Write documentation for \"Message Queues & Background Jobs\". Cover: what it is, when to use it, the Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled. pitfall, and how to verify with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Message Queues & Background Jobs. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (queue producer / worker / dead-letter handler / retry policy), the common failure pattern (Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.), the best practice (Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.), and the verification command (Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:message-queues",
          "workflow:explain",
          "docs",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "multi_tenant_isolation_explain",
      "title": "Multi-Tenant Data Isolation: Explain",
      "description": "[Multi-Tenant Data Isolation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "trigger": "Write documentation for \"Multi-Tenant Data Isolation\". Cover: what it is, when to use it, the Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data. pitfall, and how to verify with RLS policy test with two different tenant sessions + data leakage check. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Multi-Tenant Data Isolation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (RLS policy / tenant context middleware / session variable injection / tenant-aware query builder), the common failure pattern (Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.), the best practice (Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.), and the verification command (RLS policy test with two different tenant sessions + data leakage check).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:explain",
          "docs",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_api_routes_explain",
      "title": "Next.js API Routes & Route Handlers: Explain",
      "description": "[Next.js API Routes & Route Handlers] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "trigger": "Write documentation for \"Next.js API Routes & Route Handlers\". Cover: what it is, when to use it, the Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component. pitfall, and how to verify with curl --verbose + API route error log + status code audit. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Next.js API Routes & Route Handlers. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (route.ts handler / server action / API client wrapper / error boundary), the common failure pattern (Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.), the best practice (All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.), and the verification command (curl --verbose + API route error log + status code audit).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:explain",
          "docs",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_data_fetching_explain",
      "title": "Next.js Data Fetching Patterns: Explain",
      "description": "[Next.js Data Fetching Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "trigger": "Write documentation for \"Next.js Data Fetching Patterns\". Cover: what it is, when to use it, the Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests. pitfall, and how to verify with next build --debug + React DevTools fetch profiling. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Next.js Data Fetching Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (server fetch / React cache wrapper / streaming suspense boundary), the common failure pattern (Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.), the best practice (Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.), and the verification command (next build --debug + React DevTools fetch profiling).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:explain",
          "docs",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_middleware_explain",
      "title": "Next.js Middleware & Edge Runtime: Explain",
      "description": "[Next.js Middleware & Edge Runtime] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "trigger": "Write documentation for \"Next.js Middleware & Edge Runtime\". Cover: what it is, when to use it, the Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes. pitfall, and how to verify with next dev + curl --cookie tests + edge runtime log inspection. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Next.js Middleware & Edge Runtime. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (middleware.ts / rewrite rule / cookie-based redirect / geolocation routing), the common failure pattern (Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.), the best practice (Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.), and the verification command (next dev + curl --cookie tests + edge runtime log inspection).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-middleware",
          "workflow:explain",
          "docs",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_error_handling_explain",
      "title": "Node.js Error Handling & Resilience: Explain",
      "description": "[Node.js Error Handling & Resilience] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "trigger": "Write documentation for \"Node.js Error Handling & Resilience\". Cover: what it is, when to use it, the Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context. pitfall, and how to verify with node --unhandled-rejections=strict + process.on('uncaughtException') log. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Node.js Error Handling & Resilience. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (global error handler / async wrapper / structured error response / retry logic), the common failure pattern (Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.), the best practice (Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.), and the verification command (node --unhandled-rejections=strict + process.on('uncaughtException') log).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-error-handling",
          "workflow:explain",
          "docs",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_streams_explain",
      "title": "Node.js Streams & Backpressure: Explain",
      "description": "[Node.js Streams & Backpressure] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "trigger": "Write documentation for \"Node.js Streams & Backpressure\". Cover: what it is, when to use it, the Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams. pitfall, and how to verify with Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Node.js Streams & Backpressure. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (Readable/Writable stream / Transform / pipeline() refactor), the common failure pattern (Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.), the best practice (Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.), and the verification command (Node.js --inspect memory heap snapshot + stream highWaterMark tuning).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-streams",
          "workflow:explain",
          "docs",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "oauth_flows_explain",
      "title": "OAuth 2.0 Flows & Token Management: Explain",
      "description": "[OAuth 2.0 Flows & Token Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "trigger": "Write documentation for \"OAuth 2.0 Flows & Token Management\". Cover: what it is, when to use it, the Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation. pitfall, and how to verify with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting OAuth 2.0 Flows & Token Management. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (OAuth callback / token refresh / PKCE flow / httpOnly cookie handler), the common failure pattern (Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.), the best practice (Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.), and the verification command (oauth2_proxy + jwt.io debugger + curl --cookie with token inspection).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:oauth-flows",
          "workflow:explain",
          "docs",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "openapi_spec_explain",
      "title": "OpenAPI Specification & Validation: Explain",
      "description": "[OpenAPI Specification & Validation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "trigger": "Write documentation for \"OpenAPI Specification & Validation\". Cover: what it is, when to use it, the Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code. pitfall, and how to verify with redocly lint + openapi-diff + swagger-ui preview. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting OpenAPI Specification & Validation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (openapi.yaml / code-first generator / request/response validation middleware), the common failure pattern (Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.), the best practice (Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.), and the verification command (redocly lint + openapi-diff + swagger-ui preview).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:openapi-spec",
          "workflow:explain",
          "docs",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "playwright_selectors_explain",
      "title": "Playwright Selectors & Locators: Explain",
      "description": "[Playwright Selectors & Locators] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "trigger": "Write documentation for \"Playwright Selectors & Locators\". Cover: what it is, when to use it, the Using fragile CSS selectors (nth-child, class names that change) that break on every UI update. pitfall, and how to verify with playwright test --reporter=html + playwright codegen + trace viewer. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Playwright Selectors & Locators. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (locator refactor / test fixture / POM (Page Object Model) / custom fixture), the common failure pattern (Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.), the best practice (Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.), and the verification command (playwright test --reporter=html + playwright codegen + trace viewer).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:playwright-selectors",
          "workflow:explain",
          "docs",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "prompt_injection_defense_explain",
      "title": "Prompt Injection Defense: Explain",
      "description": "[Prompt Injection Defense] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "trigger": "Write documentation for \"Prompt Injection Defense\". Cover: what it is, when to use it, the Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'. pitfall, and how to verify with prompt injection test suite + adversarial input fuzzing + output scanner. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Prompt Injection Defense. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (defensive system prompt / input sanitizer / instruction guardrail / output validator), the common failure pattern (Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.), the best practice (Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.), and the verification command (prompt injection test suite + adversarial input fuzzing + output scanner).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:explain",
          "docs",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_async_explain",
      "title": "Python Async/Await Patterns: Explain",
      "description": "[Python Async/Await Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "trigger": "Write documentation for \"Python Async/Await Patterns\". Cover: what it is, when to use it, the Blocking the event loop by using synchronous requests or time.sleep inside async functions. pitfall, and how to verify with python3 -m asyncio + aiohttp/httpx async benchmark. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Python Async/Await Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (async/await refactor / asyncio.gather / async context manager), the common failure pattern (Blocking the event loop by using synchronous requests or time.sleep inside async functions.), the best practice (Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.), and the verification command (python3 -m asyncio + aiohttp/httpx async benchmark).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-async",
          "workflow:explain",
          "docs",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_file_io_explain",
      "title": "Python File I/O & Encoding: Explain",
      "description": "[Python File I/O & Encoding] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "trigger": "Write documentation for \"Python File I/O & Encoding\". Cover: what it is, when to use it, the Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content. pitfall, and how to verify with python3 -c with open() + chardet encoding detection. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Python File I/O & Encoding. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (pathlib refactor / encoding-safe file reader / batch file processor), the common failure pattern (Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.), the best practice (Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.), and the verification command (python3 -c with open() + chardet encoding detection).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-file-io",
          "workflow:explain",
          "docs",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rag_chunking_explain",
      "title": "RAG Chunking Strategies: Explain",
      "description": "[RAG Chunking Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "trigger": "Write documentation for \"RAG Chunking Strategies\". Cover: what it is, when to use it, the Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality. pitfall, and how to verify with retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting RAG Chunking Strategies. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment), the common failure pattern (Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.), the best practice (Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.), and the verification command (retrieval evaluation script + chunk boundary visualisation + recall@k measurement).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rag-chunking",
          "workflow:explain",
          "docs",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rate_limiting_proxy_explain",
      "title": "Rate Limiting & API Gateway Proxy: Explain",
      "description": "[Rate Limiting & API Gateway Proxy] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "trigger": "Write documentation for \"Rate Limiting & API Gateway Proxy\". Cover: what it is, when to use it, the Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources. pitfall, and how to verify with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Rate Limiting & API Gateway Proxy. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation), the common failure pattern (Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.), the best practice (Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.), and the verification command (ab -n 1000 -c 10 + nginx error log + 429 response code monitoring).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:explain",
          "docs",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_server_components_explain",
      "title": "React Server Components: Explain",
      "description": "[React Server Components] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "trigger": "Write documentation for \"React Server Components\". Cover: what it is, when to use it, the Accidentally making a server component a client component by using hooks or event handlers in the wrong file. pitfall, and how to verify with next build --debug + React Server Components lint rule. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting React Server Components. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (server component / client boundary refactor / streaming fallback), the common failure pattern (Accidentally making a server component a client component by using hooks or event handlers in the wrong file.), the best practice (Keep data fetching and heavy logic in server components; pass results as props to client islands.), and the verification command (next build --debug + React Server Components lint rule).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-server-components",
          "workflow:explain",
          "docs",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_state_explain",
      "title": "React State Management: Explain",
      "description": "[React State Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "trigger": "Write documentation for \"React State Management\". Cover: what it is, when to use it, the Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation. pitfall, and how to verify with React DevTools profiler + why-did-you-render. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting React State Management. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (useState / useReducer / useContext hook refactor, zustand or jotai store slice), the common failure pattern (Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.), the best practice (Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.), and the verification command (React DevTools profiler + why-did-you-render).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-state",
          "workflow:explain",
          "docs",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "redis_caching_explain",
      "title": "Redis Caching Strategies: Explain",
      "description": "[Redis Caching Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "trigger": "Write documentation for \"Redis Caching Strategies\". Cover: what it is, when to use it, the Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time. pitfall, and how to verify with redis-cli --stat + cache hit ratio monitoring + slow log. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Redis Caching Strategies. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (cache wrapper / mutex lock / stale-while-revalidate / TTL policy), the common failure pattern (Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.), the best practice (Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.), and the verification command (redis-cli --stat + cache hit ratio monitoring + slow log).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:redis-caching",
          "workflow:explain",
          "docs",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rest_pagination_explain",
      "title": "REST Pagination Design: Explain",
      "description": "[REST Pagination Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "trigger": "Write documentation for \"REST Pagination Design\". Cover: what it is, when to use it, the Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows. pitfall, and how to verify with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting REST Pagination Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (cursor pagination / offset pagination fallback / total count optimisation / response envelope), the common failure pattern (Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.), the best practice (Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.), and the verification command (curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rest-pagination",
          "workflow:explain",
          "docs",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "secrets_rotation_explain",
      "title": "Secrets Rotation Policy: Explain",
      "description": "[Secrets Rotation Policy] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "trigger": "Write documentation for \"Secrets Rotation Policy\". Cover: what it is, when to use it, the Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak. pitfall, and how to verify with vault lease list + secret expiry check + rotation dry-run test. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Secrets Rotation Policy. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (rotation script / vault integration / lease management / incident response plan), the common failure pattern (Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.), the best practice (Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.), and the verification command (vault lease list + secret expiry check + rotation dry-run test).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:secrets-rotation",
          "workflow:explain",
          "docs",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "shell_script_robustness_explain",
      "title": "Shell Script Robustness & Safety: Explain",
      "description": "[Shell Script Robustness & Safety] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "trigger": "Write documentation for \"Shell Script Robustness & Safety\". Cover: what it is, when to use it, the Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage. pitfall, and how to verify with shellcheck script.sh + bash -n script.sh + dry-run mode test. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Shell Script Robustness & Safety. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function), the common failure pattern (Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.), the best practice (Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.), and the verification command (shellcheck script.sh + bash -n script.sh + dry-run mode test).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:shell-script-robustness",
          "workflow:explain",
          "docs",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "sql_query_optimization_explain",
      "title": "SQL Query Optimisation: Explain",
      "description": "[SQL Query Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "trigger": "Write documentation for \"SQL Query Optimisation\". Cover: what it is, when to use it, the Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs. pitfall, and how to verify with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting SQL Query Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (indexed query / composite index / EXPLAIN ANALYSE plan / partial index), the common failure pattern (Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.), the best practice (Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.), and the verification command (EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:sql-query-optimization",
          "workflow:explain",
          "docs",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stealth_web_research_explain",
      "title": "Stealth Web Research & Harvesting: Explain",
      "description": "[Stealth Web Research & Harvesting] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "trigger": "Write documentation for \"Stealth Web Research & Harvesting\". Cover: what it is, when to use it, the Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests. pitfall, and how to verify with playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Stealth Web Research & Harvesting. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages), the common failure pattern (Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.), the best practice (Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.), and the verification command (playwright-extra + stealth + cheerio + defuddle + manual jq inspection).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stealth-web-research",
          "workflow:explain",
          "docs",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stripe_webhook_idempotency_explain",
      "title": "Stripe Webhook Idempotency: Explain",
      "description": "[Stripe Webhook Idempotency] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "trigger": "Write documentation for \"Stripe Webhook Idempotency\". Cover: what it is, when to use it, the Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations. pitfall, and how to verify with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Stripe Webhook Idempotency. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (Webhook handler / idempotency key check / event deduplication / failed payment recovery), the common failure pattern (Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.), the best practice (Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.), and the verification command (stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:explain",
          "docs",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "supabase_rls_explain",
      "title": "Supabase Row-Level Security: Explain",
      "description": "[Supabase Row-Level Security] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "trigger": "Write documentation for \"Supabase Row-Level Security\". Cover: what it is, when to use it, the RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data. pitfall, and how to verify with supabase db check + supabase db test + RLS policy review with pg_policies. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Supabase Row-Level Security. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (RLS policy / policy test / security definer function / admin bypass), the common failure pattern (RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.), the best practice (Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.), and the verification command (supabase db check + supabase db test + RLS policy review with pg_policies).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:supabase-rls",
          "workflow:explain",
          "docs",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "terraform_state_explain",
      "title": "Terraform State Management: Explain",
      "description": "[Terraform State Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "trigger": "Write documentation for \"Terraform State Management\". Cover: what it is, when to use it, the Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure. pitfall, and how to verify with terraform plan + terraform state list + terraform state pull | jq. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Terraform State Management. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (backend config / state migration plan / state locking config / remote state datasource), the common failure pattern (Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.), the best practice (Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.), and the verification command (terraform plan + terraform state list + terraform state pull | jq).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:terraform-state",
          "workflow:explain",
          "docs",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "typescript_generics_explain",
      "title": "TypeScript Generics & Advanced Types: Explain",
      "description": "[TypeScript Generics & Advanced Types] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "trigger": "Write documentation for \"TypeScript Generics & Advanced Types\". Cover: what it is, when to use it, the Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice). pitfall, and how to verify with tsc --noEmit --strict + type tests with expect-type. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting TypeScript Generics & Advanced Types. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (generic type / conditional type / mapped type / branded type), the common failure pattern (Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).), the best practice (Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.), and the verification command (tsc --noEmit --strict + type tests with expect-type).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:typescript-generics",
          "workflow:explain",
          "docs",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "user_onboarding_flow_explain",
      "title": "User Onboarding Flow Design: Explain",
      "description": "[User Onboarding Flow Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "trigger": "Write documentation for \"User Onboarding Flow Design\". Cover: what it is, when to use it, the Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value. pitfall, and how to verify with analytics funnel analysis + onboarding completion rate + drop-off heatmap. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting User Onboarding Flow Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (onboarding wizard / feature checklist / in-app guide / first-run experience spec), the common failure pattern (Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.), the best practice (Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.), and the verification command (analytics funnel analysis + onboarding completion rate + drop-off heatmap).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:explain",
          "docs",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "vercel_env_vars_explain",
      "title": "Vercel Environment Variables: Explain",
      "description": "[Vercel Environment Variables] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "trigger": "Write documentation for \"Vercel Environment Variables\". Cover: what it is, when to use it, the Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments. pitfall, and how to verify with vercel env pull + vercel list + project settings audit. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Vercel Environment Variables. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (vercel.json env group / preview env config / Edge Config / KV store), the common failure pattern (Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.), the best practice (Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.), and the verification command (vercel env pull + vercel list + project settings audit).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:vercel-env-vars",
          "workflow:explain",
          "docs",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_scraping_ethics_explain",
      "title": "Web Scraping Ethics & Compliance: Explain",
      "description": "[Web Scraping Ethics & Compliance] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "trigger": "Write documentation for \"Web Scraping Ethics & Compliance\". Cover: what it is, when to use it, the Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues. pitfall, and how to verify with curl robots.txt + wget --wait + scraper log audit. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Web Scraping Ethics & Compliance. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (robots.txt check / polite scraper / rate-limited crawler / cached scraper), the common failure pattern (Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.), the best practice (Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.), and the verification command (curl robots.txt + wget --wait + scraper log audit).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:explain",
          "docs",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "websocket_reconnection_explain",
      "title": "WebSocket Reconnection Strategies: Explain",
      "description": "[WebSocket Reconnection Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "trigger": "Write documentation for \"WebSocket Reconnection Strategies\". Cover: what it is, when to use it, the Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state. pitfall, and how to verify with Browser DevTools Network tab WS filter + reconnection test with server restart. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting WebSocket Reconnection Strategies. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (WebSocket client / reconnection logic / heartbeat / connection status component), the common failure pattern (Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.), the best practice (Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.), and the verification command (Browser DevTools Network tab WS filter + reconnection test with server restart).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:websocket-reconnection",
          "workflow:explain",
          "docs",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_vitals_optimization_explain",
      "title": "Web Vitals Optimisation (LCP/CLS/INP): Explain",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "trigger": "Write documentation for \"Web Vitals Optimisation (LCP/CLS/INP)\". Cover: what it is, when to use it, the Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions). pitfall, and how to verify with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are documenting Web Vitals Optimisation (LCP/CLS/INP). Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (image optimisation / font display swap / critical CSS / lazy load / bundle analysis), the common failure pattern (Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).), the best practice (Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.), and the verification command (Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:explain",
          "docs",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "context_window_budget_explain",
      "title": "LLM Context Window Budget Management: Explain",
      "description": "[LLM Context Window Budget Management] Document the domain: purpose, output, common failure, best practice, verification command Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "trigger": "Write documentation for \"LLM Context Window Budget Management\". Cover: what it is, when to use it, the Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness. pitfall, and how to verify with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Output must be readable by both humans and AI agents.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        }
      ],
      "promptTemplate": "You are documenting LLM Context Window Budget Management. Document the domain: purpose, output, common failure, best practice, verification command. Cover: the purpose, the output (trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard), the common failure pattern (Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.), the best practice (Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.), and the verification command (tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry).",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:context-window-budget",
          "workflow:explain",
          "documentation",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "codebase_navigator",
      "title": "Codebase Navigator",
      "description": "Scans a repository to identify the files relevant to a given goal, maps dependency relationships, and produces a minimal-change plan. Reduces the risk of unintended side-effects by flagging shared modules.",
      "trigger": "Call this before writing any code in an unfamiliar repository or before modifying a system you have not fully explored.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "fileMap": {
            "type": "object",
            "description": "Directory tree or search results from repository exploration."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "List the project's top-level directory structure. For each directory, summarise its purpose based on file names and imports. Identify the files most likely related to the user's goal. Map their import/export dependencies. Highlight potential side-effect files (shared utilities, common types, global config). Produce a minimal set of files to modify, ordered by dependency. Flag any files that are safe to edit versus those that need cautious amendment.",
      "metadata": {
        "risk": "low",
        "tags": [
          "exploration",
          "impact-analysis",
          "repo-mapping"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "implementation_sprint",
      "title": "Implementation Sprint",
      "description": "Turns a plan into small, independently verifiable code patches. Each patch includes a clear purpose, file list, expected behaviour change, and a validation command. Dependencies are resolved first; UI and polish come last.",
      "trigger": "Call this after a plan is approved and you are ready to start writing or editing code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "Divide the approved plan into patches of no more than 3 files each. For each patch: state the purpose, list the files, describe the expected behavioural change, and provide a verification command (lint, type-check, unit-test, or manual curl). Order patches by dependency: foundation first (types, schema), then logic (services, hooks), then binding (API, state), then presentation (UI), then polish (styles, comments). After each patch, run its verification command before proceeding.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "implementation",
          "patch",
          "incremental"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a_b_testing_framework_build",
      "title": "A/B Testing Framework: Build",
      "description": "[A/B Testing Framework] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "trigger": "Write or modify code for \"A/B Testing Framework\". The typical output is experiment spec / variant assignment / metric definition / statistical analysis script. Keep the best practice in mind: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Verify with: statsmodels sample size calculation + Bayesian A/B test + sequential testing.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for A/B Testing Framework. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is experiment spec / variant assignment / metric definition / statistical analysis script. Follow the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Run statsmodels sample size calculation + Bayesian A/B test + sequential testing after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:build",
          "implementation",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a11y_aria_patterns_build",
      "title": "Accessibility ARIA Patterns: Build",
      "description": "[Accessibility ARIA Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "trigger": "Write or modify code for \"Accessibility ARIA Patterns\". The typical output is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Keep the best practice in mind: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Verify with: axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Accessibility ARIA Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Follow the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Run axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:build",
          "implementation",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "agent_tool_binding_build",
      "title": "Agent Tool Binding & Dispatch: Build",
      "description": "[Agent Tool Binding & Dispatch] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "trigger": "Write or modify code for \"Agent Tool Binding & Dispatch\". The typical output is router tool / domain group / dynamic tool injection / tool usage statistics. Keep the best practice in mind: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Verify with: agent trace log + tool invocation frequency analysis + token cost audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Agent Tool Binding & Dispatch. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is router tool / domain group / dynamic tool injection / tool usage statistics. Follow the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Run agent trace log + tool invocation frequency analysis + token cost audit after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:agent-tool-binding",
          "workflow:build",
          "implementation",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "analytics_metric_definition_build",
      "title": "Analytics Metric Definitions: Build",
      "description": "[Analytics Metric Definitions] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "trigger": "Write or modify code for \"Analytics Metric Definitions\". The typical output is metric definition / dbt model / SQL logic / dashboard tile / documentation. Keep the best practice in mind: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Verify with: dbt docs generate + dbt test --select tag:metrics + metric comparison script.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Analytics Metric Definitions. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is metric definition / dbt model / SQL logic / dashboard tile / documentation. Follow the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Run dbt docs generate + dbt test --select tag:metrics + metric comparison script after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:build",
          "implementation",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "adr_documentation_build",
      "title": "Architecture Decision Records: Build",
      "description": "[Architecture Decision Records] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "trigger": "Write or modify code for \"Architecture Decision Records\". The typical output is ADR document / decision log / template / review workflow. Keep the best practice in mind: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Verify with: adr-tools list + adr-tools generate + decision log index page.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ADR document / decision log / template / review workflow this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Architecture Decision Records. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is ADR document / decision log / template / review workflow. Follow the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Run adr-tools list + adr-tools generate + decision log index page after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:adr-documentation",
          "workflow:build",
          "implementation",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "aws_lambda_cold_start_build",
      "title": "AWS Lambda Cold Starts: Build",
      "description": "[AWS Lambda Cold Starts] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "trigger": "Write or modify code for \"AWS Lambda Cold Starts\". The typical output is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Keep the best practice in mind: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Verify with: AWS X-Ray trace + Lambda Insights + cold start dashboard.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for AWS Lambda Cold Starts. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Follow the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Run AWS X-Ray trace + Lambda Insights + cold start dashboard after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:build",
          "implementation",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "azure_bicep_build",
      "title": "Azure Bicep Infrastructure: Build",
      "description": "[Azure Bicep Infrastructure] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "trigger": "Write or modify code for \"Azure Bicep Infrastructure\". The typical output is main.bicep / module / parameter file / azd template. Keep the best practice in mind: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Verify with: az deployment group validate + az what-if + bicep build.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific main.bicep / module / parameter file / azd template this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Azure Bicep Infrastructure. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is main.bicep / module / parameter file / azd template. Follow the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Run az deployment group validate + az what-if + bicep build after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:azure-bicep",
          "workflow:build",
          "implementation",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "browser_devtools_build",
      "title": "Browser DevTools & Debugging: Build",
      "description": "[Browser DevTools & Debugging] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "trigger": "Write or modify code for \"Browser DevTools & Debugging\". The typical output is debugging workflow / breakpoint guide / performance recording / memory snapshot. Keep the best practice in mind: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Verify with: Chrome DevTools performance recording + memory heap snapshot + network throttle.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Browser DevTools & Debugging. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is debugging workflow / breakpoint guide / performance recording / memory snapshot. Follow the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Run Chrome DevTools performance recording + memory heap snapshot + network throttle after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:browser-devtools",
          "workflow:build",
          "implementation",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cli_tool_design_build",
      "title": "CLI Tool Design Patterns: Build",
      "description": "[CLI Tool Design Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "trigger": "Write or modify code for \"CLI Tool Design Patterns\". The typical output is CLI scaffolding / argument parser / exit code handler / --json output mode. Keep the best practice in mind: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Verify with: echo $? after CLI run + stderr redirection test + --json output validation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for CLI Tool Design Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is CLI scaffolding / argument parser / exit code handler / --json output mode. Follow the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Run echo $? after CLI run + stderr redirection test + --json output validation after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cli-tool-design",
          "workflow:build",
          "implementation",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cloud_cost_optimization_build",
      "title": "Cloud Cost Optimisation: Build",
      "description": "[Cloud Cost Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "trigger": "Write or modify code for \"Cloud Cost Optimisation\". The typical output is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Keep the best practice in mind: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Verify with: cloud cost explorer + instance utilisation report + auto-stop Lambda function test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Cloud Cost Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Follow the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Run cloud cost explorer + instance utilisation report + auto-stop Lambda function test after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:build",
          "implementation",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "code_review_checklist_build",
      "title": "Code Review Checklist: Build",
      "description": "[Code Review Checklist] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "trigger": "Write or modify code for \"Code Review Checklist\". The typical output is review checklist / automated review comment / risk classification / diff summary. Keep the best practice in mind: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Verify with: git diff --stat + lint-staged + danger.js automated review + commitlint.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Code Review Checklist. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is review checklist / automated review comment / risk classification / diff summary. Follow the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Run git diff --stat + lint-staged + danger.js automated review + commitlint after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:code-review-checklist",
          "workflow:build",
          "implementation",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "convex_functions_build",
      "title": "Convex Functions & Mutations: Build",
      "description": "[Convex Functions & Mutations] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "trigger": "Write or modify code for \"Convex Functions & Mutations\". The typical output is mutation / query / action / component / scheduler job. Keep the best practice in mind: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Verify with: npx convex dev + dashboard OCC conflict log + custom retry logic.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific mutation / query / action / component / scheduler job this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Convex Functions & Mutations. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is mutation / query / action / component / scheduler job. Follow the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Run npx convex dev + dashboard OCC conflict log + custom retry logic after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:convex-functions",
          "workflow:build",
          "implementation",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cron_job_reliability_build",
      "title": "Cron Job & Scheduled Task Reliability: Build",
      "description": "[Cron Job & Scheduled Task Reliability] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "trigger": "Write or modify code for \"Cron Job & Scheduled Task Reliability\". The typical output is crontab entry / log rotation / idempotency guard / failure alert integration. Keep the best practice in mind: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Verify with: tail -f /var/log/cron + systemctl status cron + idempotency test script.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Cron Job & Scheduled Task Reliability. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is crontab entry / log rotation / idempotency guard / failure alert integration. Follow the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Run tail -f /var/log/cron + systemctl status cron + idempotency test script after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cron-job-reliability",
          "workflow:build",
          "implementation",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "css_layout_build",
      "title": "CSS Layout & Responsiveness: Build",
      "description": "[CSS Layout & Responsiveness] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "trigger": "Write or modify code for \"CSS Layout & Responsiveness\". The typical output is CSS layout refactor / responsive grid / container query implementation. Keep the best practice in mind: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Verify with: Lighthouse mobile emulation + browser DevTools responsive mode.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for CSS Layout & Responsiveness. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is CSS layout refactor / responsive grid / container query implementation. Follow the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Run Lighthouse mobile emulation + browser DevTools responsive mode after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:css-layout",
          "workflow:build",
          "implementation",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "csv_data_cleaning_build",
      "title": "CSV Data Cleaning Pipeline: Build",
      "description": "[CSV Data Cleaning Pipeline] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "trigger": "Write or modify code for \"CSV Data Cleaning Pipeline\". The typical output is CSV parser / row validator / column type mapper / error report / cleaned output. Keep the best practice in mind: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Verify with: python3 -c csv.DictReader + validation script + row count diff.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for CSV Data Cleaning Pipeline. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is CSV parser / row validator / column type mapper / error report / cleaned output. Follow the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Run python3 -c csv.DictReader + validation script + row count diff after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:build",
          "implementation",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "database_migration_safety_build",
      "title": "Database Migration Safety: Build",
      "description": "[Database Migration Safety] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "trigger": "Write or modify code for \"Database Migration Safety\". The typical output is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Keep the best practice in mind: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Verify with: pg_locks monitoring during migration + batch backfill script + rollback test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Database Migration Safety. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Follow the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Run pg_locks monitoring during migration + batch backfill script + rollback test after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:database-migration-safety",
          "workflow:build",
          "implementation",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "data_warehouse_schema_build",
      "title": "Data Warehouse Schema Design: Build",
      "description": "[Data Warehouse Schema Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "trigger": "Write or modify code for \"Data Warehouse Schema Design\". The typical output is star schema / fact table / dimension table / ETL pipeline spec. Keep the best practice in mind: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Verify with: dbt run + dbt test + query profiling with warehouse-native tools.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Data Warehouse Schema Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is star schema / fact table / dimension table / ETL pipeline spec. Follow the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Run dbt run + dbt test + query profiling with warehouse-native tools after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:build",
          "implementation",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "design_token_system_build",
      "title": "Design Token Systems: Build",
      "description": "[Design Token Systems] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "trigger": "Write or modify code for \"Design Token Systems\". The typical output is token JSON / CSS custom properties / theme switcher / token documentation. Keep the best practice in mind: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Verify with: style-dictionary build + Storybook token viewer + token value comparison.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Design Token Systems. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is token JSON / CSS custom properties / theme switcher / token documentation. Follow the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Run style-dictionary build + Storybook token viewer + token value comparison after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:design-token-system",
          "workflow:build",
          "implementation",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_compose_networking_build",
      "title": "Docker Compose Networking: Build",
      "description": "[Docker Compose Networking] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "trigger": "Write or modify code for \"Docker Compose Networking\". The typical output is docker-compose.yml / network config / healthcheck / depends_on condition. Keep the best practice in mind: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Verify with: docker compose up --wait + docker network inspect + container logs.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Docker Compose Networking. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is docker-compose.yml / network config / healthcheck / depends_on condition. Follow the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Run docker compose up --wait + docker network inspect + container logs after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-compose-networking",
          "workflow:build",
          "implementation",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_multistage_build",
      "title": "Docker Multi-Stage Builds: Build",
      "description": "[Docker Multi-Stage Builds] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "trigger": "Write or modify code for \"Docker Multi-Stage Builds\". The typical output is multi-stage Dockerfile / .dockerignore / slim base image switch. Keep the best practice in mind: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Verify with: docker build + docker scout + dive layer analysis.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Docker Multi-Stage Builds. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is multi-stage Dockerfile / .dockerignore / slim base image switch. Follow the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Run docker build + docker scout + dive layer analysis after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-multistage",
          "workflow:build",
          "implementation",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "drizzle_schema_design_build",
      "title": "Drizzle Schema Design: Build",
      "description": "[Drizzle Schema Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "trigger": "Write or modify code for \"Drizzle Schema Design\". The typical output is schema.ts / relation map / migration SQL / Drizzle query builder. Keep the best practice in mind: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Verify with: drizzle-kit push + drizzle-kit studio + generated SQL audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Drizzle Schema Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is schema.ts / relation map / migration SQL / Drizzle query builder. Follow the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Run drizzle-kit push + drizzle-kit studio + generated SQL audit after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:build",
          "implementation",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "error_monitoring_setup_build",
      "title": "Error Monitoring & Alerting Setup: Build",
      "description": "[Error Monitoring & Alerting Setup] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "trigger": "Write or modify code for \"Error Monitoring & Alerting Setup\". The typical output is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Keep the best practice in mind: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Verify with: Sentry API error list + alert rule test + source map validation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Error Monitoring & Alerting Setup. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Follow the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Run Sentry API error list + alert rule test + source map validation after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:build",
          "implementation",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "fastapi_dependencies_build",
      "title": "FastAPI Dependency Injection: Build",
      "description": "[FastAPI Dependency Injection] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "trigger": "Write or modify code for \"FastAPI Dependency Injection\". The typical output is dependency / lifespan handler / override for testing. Keep the best practice in mind: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Verify with: uvicorn --reload + /docs interactive test + dependency graph visualisation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific dependency / lifespan handler / override for testing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for FastAPI Dependency Injection. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is dependency / lifespan handler / override for testing. Follow the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Run uvicorn --reload + /docs interactive test + dependency graph visualisation after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:build",
          "implementation",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "feature_flags_build",
      "title": "Feature Flags & Gradual Rollouts: Build",
      "description": "[Feature Flags & Gradual Rollouts] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "trigger": "Write or modify code for \"Feature Flags & Gradual Rollouts\". The typical output is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Keep the best practice in mind: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Verify with: flag evaluation log + rollout percentage monitoring + unused flag scan.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Feature Flags & Gradual Rollouts. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Follow the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Run flag evaluation log + rollout percentage monitoring + unused flag scan after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:feature-flags",
          "workflow:build",
          "implementation",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "git_conflict_resolution_build",
      "title": "Git Conflict Resolution: Build",
      "description": "[Git Conflict Resolution] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "trigger": "Write or modify code for \"Git Conflict Resolution\". The typical output is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Keep the best practice in mind: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Verify with: git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Git Conflict Resolution. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Follow the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Run git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:build",
          "implementation",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "github_actions_pipeline_build",
      "title": "GitHub Actions Pipeline Optimisation: Build",
      "description": "[GitHub Actions Pipeline Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "trigger": "Write or modify code for \"GitHub Actions Pipeline Optimisation\". The typical output is workflow YAML / cache config / matrix build / conditional job execution. Keep the best practice in mind: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Verify with: act --job test + cache hit/miss analysis + workflow graph visualisation.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for GitHub Actions Pipeline Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is workflow YAML / cache config / matrix build / conditional job execution. Follow the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Run act --job test + cache hit/miss analysis + workflow graph visualisation after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:build",
          "implementation",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "graphql_n_plus_one_build",
      "title": "GraphQL N+1 Query Prevention: Build",
      "description": "[GraphQL N+1 Query Prevention] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "trigger": "Write or modify code for \"GraphQL N+1 Query Prevention\". The typical output is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Keep the best practice in mind: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Verify with: graphql query with tracing + DataLoader statistics + SQL log analysis.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for GraphQL N+1 Query Prevention. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Follow the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Run graphql query with tracing + DataLoader statistics + SQL log analysis after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:build",
          "implementation",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "jest_test_optimization_build",
      "title": "Jest Test Optimisation: Build",
      "description": "[Jest Test Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "trigger": "Write or modify code for \"Jest Test Optimisation\". The typical output is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Keep the best practice in mind: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Verify with: jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Jest Test Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Follow the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Run jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:jest-test-optimization",
          "workflow:build",
          "implementation",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "json_schema_validation_build",
      "title": "JSON Schema Validation: Build",
      "description": "[JSON Schema Validation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "trigger": "Write or modify code for \"JSON Schema Validation\". The typical output is JSON Schema / validator middleware / type guard / error message / response parser. Keep the best practice in mind: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Verify with: ajv validate + JSON Schema test suite + response mock test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for JSON Schema Validation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is JSON Schema / validator middleware / type guard / error message / response parser. Follow the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Run ajv validate + JSON Schema test suite + response mock test after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:json-schema-validation",
          "workflow:build",
          "implementation",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_hpa_build",
      "title": "Kubernetes Horizontal Pod Autoscaling: Build",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "trigger": "Write or modify code for \"Kubernetes Horizontal Pod Autoscaling\". The typical output is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Keep the best practice in mind: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Verify with: kubectl get hpa --watch + kubectl top pods + metrics-server logs.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Kubernetes Horizontal Pod Autoscaling. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Follow the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Run kubectl get hpa --watch + kubectl top pods + metrics-server logs after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:build",
          "implementation",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_pod_lifecycle_build",
      "title": "Kubernetes Pod Lifecycle: Build",
      "description": "[Kubernetes Pod Lifecycle] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "trigger": "Write or modify code for \"Kubernetes Pod Lifecycle\". The typical output is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Keep the best practice in mind: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Verify with: kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Kubernetes Pod Lifecycle. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Follow the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Run kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:build",
          "implementation",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "context_window_budget_build",
      "title": "LLM Context Window Budget Management: Build",
      "description": "[LLM Context Window Budget Management] Implement the smallest viable patches in dependency order; each patch must be independently verifiable Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "trigger": "Write or modify code for \"LLM Context Window Budget Management\". The typical output is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Keep the best practice in mind: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Verify with: tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "diff",
          "name": "diff",
          "description": "DIFF output"
        },
        {
          "kind": "command",
          "name": "cmd",
          "description": "CMD output"
        }
      ],
      "promptTemplate": "You are implementing a change for LLM Context Window Budget Management. Implement the smallest viable patches in dependency order; each patch must be independently verifiable. The target output is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Follow the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Run tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:context-window-budget",
          "workflow:build",
          "implementation",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "mcp_tool_design_build",
      "title": "MCP Tool Design & Best Practices: Build",
      "description": "[MCP Tool Design & Best Practices] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "trigger": "Write or modify code for \"MCP Tool Design & Best Practices\". The typical output is MCP tool descriptor / resource definition / prompt template / server metadata. Keep the best practice in mind: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Verify with: mcp-cli run + mcp inspector + tool name conflict analysis.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for MCP Tool Design & Best Practices. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is MCP tool descriptor / resource definition / prompt template / server metadata. Follow the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Run mcp-cli run + mcp inspector + tool name conflict analysis after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:mcp-tool-design",
          "workflow:build",
          "implementation",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "message_queues_build",
      "title": "Message Queues & Background Jobs: Build",
      "description": "[Message Queues & Background Jobs] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "trigger": "Write or modify code for \"Message Queues & Background Jobs\". The typical output is queue producer / worker / dead-letter handler / retry policy. Keep the best practice in mind: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Verify with: Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Message Queues & Background Jobs. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is queue producer / worker / dead-letter handler / retry policy. Follow the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Run Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:message-queues",
          "workflow:build",
          "implementation",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "multi_tenant_isolation_build",
      "title": "Multi-Tenant Data Isolation: Build",
      "description": "[Multi-Tenant Data Isolation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "trigger": "Write or modify code for \"Multi-Tenant Data Isolation\". The typical output is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Keep the best practice in mind: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Verify with: RLS policy test with two different tenant sessions + data leakage check.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Multi-Tenant Data Isolation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Follow the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Run RLS policy test with two different tenant sessions + data leakage check after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:build",
          "implementation",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_api_routes_build",
      "title": "Next.js API Routes & Route Handlers: Build",
      "description": "[Next.js API Routes & Route Handlers] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "trigger": "Write or modify code for \"Next.js API Routes & Route Handlers\". The typical output is route.ts handler / server action / API client wrapper / error boundary. Keep the best practice in mind: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Verify with: curl --verbose + API route error log + status code audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Next.js API Routes & Route Handlers. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is route.ts handler / server action / API client wrapper / error boundary. Follow the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Run curl --verbose + API route error log + status code audit after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:build",
          "implementation",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_data_fetching_build",
      "title": "Next.js Data Fetching Patterns: Build",
      "description": "[Next.js Data Fetching Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "trigger": "Write or modify code for \"Next.js Data Fetching Patterns\". The typical output is server fetch / React cache wrapper / streaming suspense boundary. Keep the best practice in mind: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Verify with: next build --debug + React DevTools fetch profiling.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Next.js Data Fetching Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is server fetch / React cache wrapper / streaming suspense boundary. Follow the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Run next build --debug + React DevTools fetch profiling after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:build",
          "implementation",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_middleware_build",
      "title": "Next.js Middleware & Edge Runtime: Build",
      "description": "[Next.js Middleware & Edge Runtime] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "trigger": "Write or modify code for \"Next.js Middleware & Edge Runtime\". The typical output is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Keep the best practice in mind: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Verify with: next dev + curl --cookie tests + edge runtime log inspection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Next.js Middleware & Edge Runtime. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Follow the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Run next dev + curl --cookie tests + edge runtime log inspection after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-middleware",
          "workflow:build",
          "implementation",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_error_handling_build",
      "title": "Node.js Error Handling & Resilience: Build",
      "description": "[Node.js Error Handling & Resilience] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "trigger": "Write or modify code for \"Node.js Error Handling & Resilience\". The typical output is global error handler / async wrapper / structured error response / retry logic. Keep the best practice in mind: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Verify with: node --unhandled-rejections=strict + process.on('uncaughtException') log.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Node.js Error Handling & Resilience. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is global error handler / async wrapper / structured error response / retry logic. Follow the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Run node --unhandled-rejections=strict + process.on('uncaughtException') log after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-error-handling",
          "workflow:build",
          "implementation",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_streams_build",
      "title": "Node.js Streams & Backpressure: Build",
      "description": "[Node.js Streams & Backpressure] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "trigger": "Write or modify code for \"Node.js Streams & Backpressure\". The typical output is Readable/Writable stream / Transform / pipeline() refactor. Keep the best practice in mind: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Verify with: Node.js --inspect memory heap snapshot + stream highWaterMark tuning.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Node.js Streams & Backpressure. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is Readable/Writable stream / Transform / pipeline() refactor. Follow the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Run Node.js --inspect memory heap snapshot + stream highWaterMark tuning after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-streams",
          "workflow:build",
          "implementation",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "oauth_flows_build",
      "title": "OAuth 2.0 Flows & Token Management: Build",
      "description": "[OAuth 2.0 Flows & Token Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "trigger": "Write or modify code for \"OAuth 2.0 Flows & Token Management\". The typical output is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Keep the best practice in mind: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Verify with: oauth2_proxy + jwt.io debugger + curl --cookie with token inspection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for OAuth 2.0 Flows & Token Management. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Follow the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Run oauth2_proxy + jwt.io debugger + curl --cookie with token inspection after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:oauth-flows",
          "workflow:build",
          "implementation",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "openapi_spec_build",
      "title": "OpenAPI Specification & Validation: Build",
      "description": "[OpenAPI Specification & Validation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "trigger": "Write or modify code for \"OpenAPI Specification & Validation\". The typical output is openapi.yaml / code-first generator / request/response validation middleware. Keep the best practice in mind: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Verify with: redocly lint + openapi-diff + swagger-ui preview.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for OpenAPI Specification & Validation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is openapi.yaml / code-first generator / request/response validation middleware. Follow the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Run redocly lint + openapi-diff + swagger-ui preview after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:openapi-spec",
          "workflow:build",
          "implementation",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "playwright_selectors_build",
      "title": "Playwright Selectors & Locators: Build",
      "description": "[Playwright Selectors & Locators] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "trigger": "Write or modify code for \"Playwright Selectors & Locators\". The typical output is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Keep the best practice in mind: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Verify with: playwright test --reporter=html + playwright codegen + trace viewer.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Playwright Selectors & Locators. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Follow the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Run playwright test --reporter=html + playwright codegen + trace viewer after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:playwright-selectors",
          "workflow:build",
          "implementation",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "prompt_injection_defense_build",
      "title": "Prompt Injection Defense: Build",
      "description": "[Prompt Injection Defense] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "trigger": "Write or modify code for \"Prompt Injection Defense\". The typical output is defensive system prompt / input sanitizer / instruction guardrail / output validator. Keep the best practice in mind: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Verify with: prompt injection test suite + adversarial input fuzzing + output scanner.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Prompt Injection Defense. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is defensive system prompt / input sanitizer / instruction guardrail / output validator. Follow the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Run prompt injection test suite + adversarial input fuzzing + output scanner after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:build",
          "implementation",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_async_build",
      "title": "Python Async/Await Patterns: Build",
      "description": "[Python Async/Await Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "trigger": "Write or modify code for \"Python Async/Await Patterns\". The typical output is async/await refactor / asyncio.gather / async context manager. Keep the best practice in mind: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Verify with: python3 -m asyncio + aiohttp/httpx async benchmark.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Python Async/Await Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is async/await refactor / asyncio.gather / async context manager. Follow the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Run python3 -m asyncio + aiohttp/httpx async benchmark after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-async",
          "workflow:build",
          "implementation",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_file_io_build",
      "title": "Python File I/O & Encoding: Build",
      "description": "[Python File I/O & Encoding] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "trigger": "Write or modify code for \"Python File I/O & Encoding\". The typical output is pathlib refactor / encoding-safe file reader / batch file processor. Keep the best practice in mind: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Verify with: python3 -c with open() + chardet encoding detection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Python File I/O & Encoding. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is pathlib refactor / encoding-safe file reader / batch file processor. Follow the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Run python3 -c with open() + chardet encoding detection after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-file-io",
          "workflow:build",
          "implementation",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rag_chunking_build",
      "title": "RAG Chunking Strategies: Build",
      "description": "[RAG Chunking Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "trigger": "Write or modify code for \"RAG Chunking Strategies\". The typical output is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Keep the best practice in mind: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Verify with: retrieval evaluation script + chunk boundary visualisation + recall@k measurement.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for RAG Chunking Strategies. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Follow the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Run retrieval evaluation script + chunk boundary visualisation + recall@k measurement after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rag-chunking",
          "workflow:build",
          "implementation",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rate_limiting_proxy_build",
      "title": "Rate Limiting & API Gateway Proxy: Build",
      "description": "[Rate Limiting & API Gateway Proxy] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "trigger": "Write or modify code for \"Rate Limiting & API Gateway Proxy\". The typical output is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Keep the best practice in mind: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Verify with: ab -n 1000 -c 10 + nginx error log + 429 response code monitoring.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Rate Limiting & API Gateway Proxy. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Follow the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Run ab -n 1000 -c 10 + nginx error log + 429 response code monitoring after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:build",
          "implementation",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_server_components_build",
      "title": "React Server Components: Build",
      "description": "[React Server Components] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "trigger": "Write or modify code for \"React Server Components\". The typical output is server component / client boundary refactor / streaming fallback. Keep the best practice in mind: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Verify with: next build --debug + React Server Components lint rule.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for React Server Components. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is server component / client boundary refactor / streaming fallback. Follow the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Run next build --debug + React Server Components lint rule after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-server-components",
          "workflow:build",
          "implementation",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_state_build",
      "title": "React State Management: Build",
      "description": "[React State Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "trigger": "Write or modify code for \"React State Management\". The typical output is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Keep the best practice in mind: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Verify with: React DevTools profiler + why-did-you-render.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for React State Management. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Follow the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Run React DevTools profiler + why-did-you-render after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-state",
          "workflow:build",
          "implementation",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "redis_caching_build",
      "title": "Redis Caching Strategies: Build",
      "description": "[Redis Caching Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "trigger": "Write or modify code for \"Redis Caching Strategies\". The typical output is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Keep the best practice in mind: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Verify with: redis-cli --stat + cache hit ratio monitoring + slow log.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Redis Caching Strategies. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Follow the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Run redis-cli --stat + cache hit ratio monitoring + slow log after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:redis-caching",
          "workflow:build",
          "implementation",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rest_pagination_build",
      "title": "REST Pagination Design: Build",
      "description": "[REST Pagination Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "trigger": "Write or modify code for \"REST Pagination Design\". The typical output is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Keep the best practice in mind: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Verify with: curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for REST Pagination Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Follow the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Run curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rest-pagination",
          "workflow:build",
          "implementation",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "secrets_rotation_build",
      "title": "Secrets Rotation Policy: Build",
      "description": "[Secrets Rotation Policy] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "trigger": "Write or modify code for \"Secrets Rotation Policy\". The typical output is rotation script / vault integration / lease management / incident response plan. Keep the best practice in mind: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Verify with: vault lease list + secret expiry check + rotation dry-run test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Secrets Rotation Policy. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is rotation script / vault integration / lease management / incident response plan. Follow the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Run vault lease list + secret expiry check + rotation dry-run test after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:secrets-rotation",
          "workflow:build",
          "implementation",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "shell_script_robustness_build",
      "title": "Shell Script Robustness & Safety: Build",
      "description": "[Shell Script Robustness & Safety] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "trigger": "Write or modify code for \"Shell Script Robustness & Safety\". The typical output is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Keep the best practice in mind: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Verify with: shellcheck script.sh + bash -n script.sh + dry-run mode test.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Shell Script Robustness & Safety. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Follow the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Run shellcheck script.sh + bash -n script.sh + dry-run mode test after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:shell-script-robustness",
          "workflow:build",
          "implementation",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "sql_query_optimization_build",
      "title": "SQL Query Optimisation: Build",
      "description": "[SQL Query Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "trigger": "Write or modify code for \"SQL Query Optimisation\". The typical output is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Keep the best practice in mind: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Verify with: EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for SQL Query Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Follow the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Run EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:sql-query-optimization",
          "workflow:build",
          "implementation",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stealth_web_research_build",
      "title": "Stealth Web Research & Harvesting: Build",
      "description": "[Stealth Web Research & Harvesting] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "trigger": "Write or modify code for \"Stealth Web Research & Harvesting\". The typical output is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Keep the best practice in mind: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Verify with: playwright-extra + stealth + cheerio + defuddle + manual jq inspection.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Stealth Web Research & Harvesting. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Follow the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Run playwright-extra + stealth + cheerio + defuddle + manual jq inspection after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stealth-web-research",
          "workflow:build",
          "implementation",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stripe_webhook_idempotency_build",
      "title": "Stripe Webhook Idempotency: Build",
      "description": "[Stripe Webhook Idempotency] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "trigger": "Write or modify code for \"Stripe Webhook Idempotency\". The typical output is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Keep the best practice in mind: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Verify with: stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Stripe Webhook Idempotency. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Follow the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Run stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:build",
          "implementation",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "supabase_rls_build",
      "title": "Supabase Row-Level Security: Build",
      "description": "[Supabase Row-Level Security] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "trigger": "Write or modify code for \"Supabase Row-Level Security\". The typical output is RLS policy / policy test / security definer function / admin bypass. Keep the best practice in mind: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Verify with: supabase db check + supabase db test + RLS policy review with pg_policies.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Supabase Row-Level Security. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is RLS policy / policy test / security definer function / admin bypass. Follow the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Run supabase db check + supabase db test + RLS policy review with pg_policies after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:supabase-rls",
          "workflow:build",
          "implementation",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "terraform_state_build",
      "title": "Terraform State Management: Build",
      "description": "[Terraform State Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "trigger": "Write or modify code for \"Terraform State Management\". The typical output is backend config / state migration plan / state locking config / remote state datasource. Keep the best practice in mind: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Verify with: terraform plan + terraform state list + terraform state pull | jq.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Terraform State Management. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is backend config / state migration plan / state locking config / remote state datasource. Follow the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Run terraform plan + terraform state list + terraform state pull | jq after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:terraform-state",
          "workflow:build",
          "implementation",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "typescript_generics_build",
      "title": "TypeScript Generics & Advanced Types: Build",
      "description": "[TypeScript Generics & Advanced Types] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "trigger": "Write or modify code for \"TypeScript Generics & Advanced Types\". The typical output is generic type / conditional type / mapped type / branded type. Keep the best practice in mind: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Verify with: tsc --noEmit --strict + type tests with expect-type.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for TypeScript Generics & Advanced Types. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is generic type / conditional type / mapped type / branded type. Follow the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Run tsc --noEmit --strict + type tests with expect-type after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:typescript-generics",
          "workflow:build",
          "implementation",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "user_onboarding_flow_build",
      "title": "User Onboarding Flow Design: Build",
      "description": "[User Onboarding Flow Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "trigger": "Write or modify code for \"User Onboarding Flow Design\". The typical output is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Keep the best practice in mind: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Verify with: analytics funnel analysis + onboarding completion rate + drop-off heatmap.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for User Onboarding Flow Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Follow the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Run analytics funnel analysis + onboarding completion rate + drop-off heatmap after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:build",
          "implementation",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "vercel_env_vars_build",
      "title": "Vercel Environment Variables: Build",
      "description": "[Vercel Environment Variables] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "trigger": "Write or modify code for \"Vercel Environment Variables\". The typical output is vercel.json env group / preview env config / Edge Config / KV store. Keep the best practice in mind: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Verify with: vercel env pull + vercel list + project settings audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Vercel Environment Variables. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is vercel.json env group / preview env config / Edge Config / KV store. Follow the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Run vercel env pull + vercel list + project settings audit after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:vercel-env-vars",
          "workflow:build",
          "implementation",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_scraping_ethics_build",
      "title": "Web Scraping Ethics & Compliance: Build",
      "description": "[Web Scraping Ethics & Compliance] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "trigger": "Write or modify code for \"Web Scraping Ethics & Compliance\". The typical output is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Keep the best practice in mind: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Verify with: curl robots.txt + wget --wait + scraper log audit.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Web Scraping Ethics & Compliance. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Follow the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Run curl robots.txt + wget --wait + scraper log audit after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:build",
          "implementation",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "websocket_reconnection_build",
      "title": "WebSocket Reconnection Strategies: Build",
      "description": "[WebSocket Reconnection Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "trigger": "Write or modify code for \"WebSocket Reconnection Strategies\". The typical output is WebSocket client / reconnection logic / heartbeat / connection status component. Keep the best practice in mind: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Verify with: Browser DevTools Network tab WS filter + reconnection test with server restart.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for WebSocket Reconnection Strategies. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is WebSocket client / reconnection logic / heartbeat / connection status component. Follow the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Run Browser DevTools Network tab WS filter + reconnection test with server restart after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:websocket-reconnection",
          "workflow:build",
          "implementation",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_vitals_optimization_build",
      "title": "Web Vitals Optimisation (LCP/CLS/INP): Build",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "trigger": "Write or modify code for \"Web Vitals Optimisation (LCP/CLS/INP)\". The typical output is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Keep the best practice in mind: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Verify with: Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "diff",
          "name": "patchPlan",
          "description": "File-level change or patch plan."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are implementing a change for Web Vitals Optimisation (LCP/CLS/INP). Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Follow the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Run Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension after each patch.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:build",
          "implementation",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "adapter_smith",
      "title": "Adapter Smith",
      "description": "Converts any skill definition between agent runtime formats — Claude markdown, Hermes manifest, OpenAI tool descriptors, Cursor rules, LangChain registry, or MCP resources. Preserves the semantic contract across all formats.",
      "trigger": "Call this when you need to move a skill to a different agent system, or to produce a cross-platform export of the entire catalog.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "targetRuntime": {
            "type": "string",
            "description": "claude, hermes, openai, langchain, cursor, mcp or generic."
          }
        },
        "required": [
          "goal",
          "targetRuntime"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        }
      ],
      "promptTemplate": "Identify the source skill format and the target runtime. Map each field: slug → file name, trigger → tool description, inputs → parameter schema, outputs → response contract, examples → usage hints. Preserve all risk markers and model-agnostic guarantees. If the target format lacks a field, embed it in a comment or description field. Output the complete adapter payload.",
      "metadata": {
        "risk": "low",
        "tags": [
          "adapter",
          "converter",
          "cross-platform"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "api_contract_smith",
      "title": "API Contract Smith",
      "description": "Designs a minimal, secure API contract for integrating an external service or internal endpoint. Specifies authentication, error contracts, rate limits, idempotency, and a proxy route for server-side secret handling.",
      "trigger": "Call this when integrating a new API, designing a service boundary, or refactoring an existing endpoint contract.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "apiDocs": {
            "type": "string",
            "description": "API documentation or reference link, if available."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "Document the service purpose and authentication mechanism. List all endpoints with request and response shapes. For each endpoint: define success/error response codes, pagination (if any), rate limit headers, and idempotency key. Mandate that all secrets live in environment variables accessible only server-side. Produce a minimal Express/Next.js route that proxies the external API while stripping secrets from client payloads.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "api",
          "contract",
          "integration",
          "proxy"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a_b_testing_framework_tune",
      "title": "A/B Testing Framework: Tune",
      "description": "[A/B Testing Framework] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "trigger": "Optimize \"A/B Testing Framework\". Target the failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\" or the typical verification command statsmodels sample size calculation + Bayesian A/B test + sequential testing. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising A/B Testing Framework. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is experiment spec / variant assignment / metric definition / statistical analysis script. Measure using statsmodels sample size calculation + Bayesian A/B test + sequential testing. Guard against: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:tune",
          "optimization",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a11y_aria_patterns_tune",
      "title": "Accessibility ARIA Patterns: Tune",
      "description": "[Accessibility ARIA Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "trigger": "Optimize \"Accessibility ARIA Patterns\". Target the failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\" or the typical verification command axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Accessibility ARIA Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Measure using axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Guard against: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:tune",
          "optimization",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "agent_tool_binding_tune",
      "title": "Agent Tool Binding & Dispatch: Tune",
      "description": "[Agent Tool Binding & Dispatch] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "trigger": "Optimize \"Agent Tool Binding & Dispatch\". Target the failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\" or the typical verification command agent trace log + tool invocation frequency analysis + token cost audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Agent Tool Binding & Dispatch. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is router tool / domain group / dynamic tool injection / tool usage statistics. Measure using agent trace log + tool invocation frequency analysis + token cost audit. Guard against: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:agent-tool-binding",
          "workflow:tune",
          "optimization",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "analytics_metric_definition_tune",
      "title": "Analytics Metric Definitions: Tune",
      "description": "[Analytics Metric Definitions] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "trigger": "Optimize \"Analytics Metric Definitions\". Target the failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\" or the typical verification command dbt docs generate + dbt test --select tag:metrics + metric comparison script. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Analytics Metric Definitions. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is metric definition / dbt model / SQL logic / dashboard tile / documentation. Measure using dbt docs generate + dbt test --select tag:metrics + metric comparison script. Guard against: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:tune",
          "optimization",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "adr_documentation_tune",
      "title": "Architecture Decision Records: Tune",
      "description": "[Architecture Decision Records] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "trigger": "Optimize \"Architecture Decision Records\". Target the failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\" or the typical verification command adr-tools list + adr-tools generate + decision log index page. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ADR document / decision log / template / review workflow this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Architecture Decision Records. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is ADR document / decision log / template / review workflow. Measure using adr-tools list + adr-tools generate + decision log index page. Guard against: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:adr-documentation",
          "workflow:tune",
          "optimization",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "aws_lambda_cold_start_tune",
      "title": "AWS Lambda Cold Starts: Tune",
      "description": "[AWS Lambda Cold Starts] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "trigger": "Optimize \"AWS Lambda Cold Starts\". Target the failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\" or the typical verification command AWS X-Ray trace + Lambda Insights + cold start dashboard. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising AWS Lambda Cold Starts. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Measure using AWS X-Ray trace + Lambda Insights + cold start dashboard. Guard against: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:tune",
          "optimization",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "azure_bicep_tune",
      "title": "Azure Bicep Infrastructure: Tune",
      "description": "[Azure Bicep Infrastructure] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "trigger": "Optimize \"Azure Bicep Infrastructure\". Target the failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\" or the typical verification command az deployment group validate + az what-if + bicep build. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific main.bicep / module / parameter file / azd template this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Azure Bicep Infrastructure. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is main.bicep / module / parameter file / azd template. Measure using az deployment group validate + az what-if + bicep build. Guard against: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:azure-bicep",
          "workflow:tune",
          "optimization",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "browser_devtools_tune",
      "title": "Browser DevTools & Debugging: Tune",
      "description": "[Browser DevTools & Debugging] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "trigger": "Optimize \"Browser DevTools & Debugging\". Target the failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\" or the typical verification command Chrome DevTools performance recording + memory heap snapshot + network throttle. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Browser DevTools & Debugging. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is debugging workflow / breakpoint guide / performance recording / memory snapshot. Measure using Chrome DevTools performance recording + memory heap snapshot + network throttle. Guard against: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:browser-devtools",
          "workflow:tune",
          "optimization",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cli_tool_design_tune",
      "title": "CLI Tool Design Patterns: Tune",
      "description": "[CLI Tool Design Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "trigger": "Optimize \"CLI Tool Design Patterns\". Target the failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\" or the typical verification command echo $? after CLI run + stderr redirection test + --json output validation. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising CLI Tool Design Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is CLI scaffolding / argument parser / exit code handler / --json output mode. Measure using echo $? after CLI run + stderr redirection test + --json output validation. Guard against: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cli-tool-design",
          "workflow:tune",
          "optimization",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cloud_cost_optimization_tune",
      "title": "Cloud Cost Optimisation: Tune",
      "description": "[Cloud Cost Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "trigger": "Optimize \"Cloud Cost Optimisation\". Target the failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\" or the typical verification command cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Cloud Cost Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Measure using cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Guard against: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:tune",
          "optimization",
          "cloud",
          "cost"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "code_review_checklist_tune",
      "title": "Code Review Checklist: Tune",
      "description": "[Code Review Checklist] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "trigger": "Optimize \"Code Review Checklist\". Target the failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\" or the typical verification command git diff --stat + lint-staged + danger.js automated review + commitlint. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Code Review Checklist. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is review checklist / automated review comment / risk classification / diff summary. Measure using git diff --stat + lint-staged + danger.js automated review + commitlint. Guard against: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:code-review-checklist",
          "workflow:tune",
          "optimization",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "convex_functions_tune",
      "title": "Convex Functions & Mutations: Tune",
      "description": "[Convex Functions & Mutations] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "trigger": "Optimize \"Convex Functions & Mutations\". Target the failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\" or the typical verification command npx convex dev + dashboard OCC conflict log + custom retry logic. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific mutation / query / action / component / scheduler job this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Convex Functions & Mutations. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is mutation / query / action / component / scheduler job. Measure using npx convex dev + dashboard OCC conflict log + custom retry logic. Guard against: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:convex-functions",
          "workflow:tune",
          "optimization",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cron_job_reliability_tune",
      "title": "Cron Job & Scheduled Task Reliability: Tune",
      "description": "[Cron Job & Scheduled Task Reliability] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "trigger": "Optimize \"Cron Job & Scheduled Task Reliability\". Target the failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\" or the typical verification command tail -f /var/log/cron + systemctl status cron + idempotency test script. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Cron Job & Scheduled Task Reliability. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is crontab entry / log rotation / idempotency guard / failure alert integration. Measure using tail -f /var/log/cron + systemctl status cron + idempotency test script. Guard against: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:cron-job-reliability",
          "workflow:tune",
          "optimization",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "css_layout_tune",
      "title": "CSS Layout & Responsiveness: Tune",
      "description": "[CSS Layout & Responsiveness] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "trigger": "Optimize \"CSS Layout & Responsiveness\". Target the failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\" or the typical verification command Lighthouse mobile emulation + browser DevTools responsive mode. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising CSS Layout & Responsiveness. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is CSS layout refactor / responsive grid / container query implementation. Measure using Lighthouse mobile emulation + browser DevTools responsive mode. Guard against: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:css-layout",
          "workflow:tune",
          "optimization",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "csv_data_cleaning_tune",
      "title": "CSV Data Cleaning Pipeline: Tune",
      "description": "[CSV Data Cleaning Pipeline] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "trigger": "Optimize \"CSV Data Cleaning Pipeline\". Target the failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\" or the typical verification command python3 -c csv.DictReader + validation script + row count diff. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising CSV Data Cleaning Pipeline. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is CSV parser / row validator / column type mapper / error report / cleaned output. Measure using python3 -c csv.DictReader + validation script + row count diff. Guard against: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:tune",
          "optimization",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "database_migration_safety_tune",
      "title": "Database Migration Safety: Tune",
      "description": "[Database Migration Safety] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "trigger": "Optimize \"Database Migration Safety\". Target the failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\" or the typical verification command pg_locks monitoring during migration + batch backfill script + rollback test. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Database Migration Safety. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Measure using pg_locks monitoring during migration + batch backfill script + rollback test. Guard against: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:database-migration-safety",
          "workflow:tune",
          "optimization",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "data_warehouse_schema_tune",
      "title": "Data Warehouse Schema Design: Tune",
      "description": "[Data Warehouse Schema Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "trigger": "Optimize \"Data Warehouse Schema Design\". Target the failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\" or the typical verification command dbt run + dbt test + query profiling with warehouse-native tools. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Data Warehouse Schema Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is star schema / fact table / dimension table / ETL pipeline spec. Measure using dbt run + dbt test + query profiling with warehouse-native tools. Guard against: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:tune",
          "optimization",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "design_token_system_tune",
      "title": "Design Token Systems: Tune",
      "description": "[Design Token Systems] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "trigger": "Optimize \"Design Token Systems\". Target the failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\" or the typical verification command style-dictionary build + Storybook token viewer + token value comparison. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Design Token Systems. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is token JSON / CSS custom properties / theme switcher / token documentation. Measure using style-dictionary build + Storybook token viewer + token value comparison. Guard against: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:design-token-system",
          "workflow:tune",
          "optimization",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_compose_networking_tune",
      "title": "Docker Compose Networking: Tune",
      "description": "[Docker Compose Networking] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "trigger": "Optimize \"Docker Compose Networking\". Target the failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\" or the typical verification command docker compose up --wait + docker network inspect + container logs. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Docker Compose Networking. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is docker-compose.yml / network config / healthcheck / depends_on condition. Measure using docker compose up --wait + docker network inspect + container logs. Guard against: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-compose-networking",
          "workflow:tune",
          "optimization",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_multistage_tune",
      "title": "Docker Multi-Stage Builds: Tune",
      "description": "[Docker Multi-Stage Builds] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "trigger": "Optimize \"Docker Multi-Stage Builds\". Target the failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\" or the typical verification command docker build + docker scout + dive layer analysis. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Docker Multi-Stage Builds. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is multi-stage Dockerfile / .dockerignore / slim base image switch. Measure using docker build + docker scout + dive layer analysis. Guard against: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:docker-multistage",
          "workflow:tune",
          "optimization",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "drizzle_schema_design_tune",
      "title": "Drizzle Schema Design: Tune",
      "description": "[Drizzle Schema Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "trigger": "Optimize \"Drizzle Schema Design\". Target the failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\" or the typical verification command drizzle-kit push + drizzle-kit studio + generated SQL audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Drizzle Schema Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is schema.ts / relation map / migration SQL / Drizzle query builder. Measure using drizzle-kit push + drizzle-kit studio + generated SQL audit. Guard against: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:tune",
          "optimization",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "error_monitoring_setup_tune",
      "title": "Error Monitoring & Alerting Setup: Tune",
      "description": "[Error Monitoring & Alerting Setup] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "trigger": "Optimize \"Error Monitoring & Alerting Setup\". Target the failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\" or the typical verification command Sentry API error list + alert rule test + source map validation. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Error Monitoring & Alerting Setup. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Measure using Sentry API error list + alert rule test + source map validation. Guard against: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:tune",
          "optimization",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "fastapi_dependencies_tune",
      "title": "FastAPI Dependency Injection: Tune",
      "description": "[FastAPI Dependency Injection] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "trigger": "Optimize \"FastAPI Dependency Injection\". Target the failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\" or the typical verification command uvicorn --reload + /docs interactive test + dependency graph visualisation. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific dependency / lifespan handler / override for testing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising FastAPI Dependency Injection. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is dependency / lifespan handler / override for testing. Measure using uvicorn --reload + /docs interactive test + dependency graph visualisation. Guard against: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:tune",
          "optimization",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "feature_flags_tune",
      "title": "Feature Flags & Gradual Rollouts: Tune",
      "description": "[Feature Flags & Gradual Rollouts] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "trigger": "Optimize \"Feature Flags & Gradual Rollouts\". Target the failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\" or the typical verification command flag evaluation log + rollout percentage monitoring + unused flag scan. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Feature Flags & Gradual Rollouts. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Measure using flag evaluation log + rollout percentage monitoring + unused flag scan. Guard against: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:feature-flags",
          "workflow:tune",
          "optimization",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "git_conflict_resolution_tune",
      "title": "Git Conflict Resolution: Tune",
      "description": "[Git Conflict Resolution] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "trigger": "Optimize \"Git Conflict Resolution\". Target the failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\" or the typical verification command git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Git Conflict Resolution. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Measure using git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Guard against: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:tune",
          "optimization",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "github_actions_pipeline_tune",
      "title": "GitHub Actions Pipeline Optimisation: Tune",
      "description": "[GitHub Actions Pipeline Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "trigger": "Optimize \"GitHub Actions Pipeline Optimisation\". Target the failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\" or the typical verification command act --job test + cache hit/miss analysis + workflow graph visualisation. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising GitHub Actions Pipeline Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is workflow YAML / cache config / matrix build / conditional job execution. Measure using act --job test + cache hit/miss analysis + workflow graph visualisation. Guard against: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:tune",
          "optimization",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "graphql_n_plus_one_tune",
      "title": "GraphQL N+1 Query Prevention: Tune",
      "description": "[GraphQL N+1 Query Prevention] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "trigger": "Optimize \"GraphQL N+1 Query Prevention\". Target the failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\" or the typical verification command graphql query with tracing + DataLoader statistics + SQL log analysis. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising GraphQL N+1 Query Prevention. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Measure using graphql query with tracing + DataLoader statistics + SQL log analysis. Guard against: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:tune",
          "optimization",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "jest_test_optimization_tune",
      "title": "Jest Test Optimisation: Tune",
      "description": "[Jest Test Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "trigger": "Optimize \"Jest Test Optimisation\". Target the failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\" or the typical verification command jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Jest Test Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Measure using jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Guard against: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:jest-test-optimization",
          "workflow:tune",
          "optimization",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "json_schema_validation_tune",
      "title": "JSON Schema Validation: Tune",
      "description": "[JSON Schema Validation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "trigger": "Optimize \"JSON Schema Validation\". Target the failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\" or the typical verification command ajv validate + JSON Schema test suite + response mock test. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising JSON Schema Validation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is JSON Schema / validator middleware / type guard / error message / response parser. Measure using ajv validate + JSON Schema test suite + response mock test. Guard against: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:json-schema-validation",
          "workflow:tune",
          "optimization",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_hpa_tune",
      "title": "Kubernetes Horizontal Pod Autoscaling: Tune",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "trigger": "Optimize \"Kubernetes Horizontal Pod Autoscaling\". Target the failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\" or the typical verification command kubectl get hpa --watch + kubectl top pods + metrics-server logs. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Kubernetes Horizontal Pod Autoscaling. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Measure using kubectl get hpa --watch + kubectl top pods + metrics-server logs. Guard against: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:tune",
          "optimization",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_pod_lifecycle_tune",
      "title": "Kubernetes Pod Lifecycle: Tune",
      "description": "[Kubernetes Pod Lifecycle] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "trigger": "Optimize \"Kubernetes Pod Lifecycle\". Target the failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\" or the typical verification command kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Kubernetes Pod Lifecycle. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Measure using kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Guard against: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:tune",
          "optimization",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "context_window_budget_tune",
      "title": "LLM Context Window Budget Management: Tune",
      "description": "[LLM Context Window Budget Management] Measure baseline, optimise with non-breaking changes, measure again, report before/after Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "trigger": "Optimise \"LLM Context Window Budget Management\". Target the failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\" or the typical verification command tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "command",
          "name": "cmd",
          "description": "CMD output"
        }
      ],
      "promptTemplate": "You are optimising LLM Context Window Budget Management. Measure baseline, optimise with non-breaking changes, measure again, report before/after. The target is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Measure using tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Guard against: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:context-window-budget",
          "workflow:tune",
          "optimization",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "mcp_tool_design_tune",
      "title": "MCP Tool Design & Best Practices: Tune",
      "description": "[MCP Tool Design & Best Practices] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "trigger": "Optimize \"MCP Tool Design & Best Practices\". Target the failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\" or the typical verification command mcp-cli run + mcp inspector + tool name conflict analysis. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising MCP Tool Design & Best Practices. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is MCP tool descriptor / resource definition / prompt template / server metadata. Measure using mcp-cli run + mcp inspector + tool name conflict analysis. Guard against: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:mcp-tool-design",
          "workflow:tune",
          "optimization",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "message_queues_tune",
      "title": "Message Queues & Background Jobs: Tune",
      "description": "[Message Queues & Background Jobs] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "trigger": "Optimize \"Message Queues & Background Jobs\". Target the failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\" or the typical verification command Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Message Queues & Background Jobs. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is queue producer / worker / dead-letter handler / retry policy. Measure using Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Guard against: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:message-queues",
          "workflow:tune",
          "optimization",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "multi_tenant_isolation_tune",
      "title": "Multi-Tenant Data Isolation: Tune",
      "description": "[Multi-Tenant Data Isolation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "trigger": "Optimize \"Multi-Tenant Data Isolation\". Target the failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\" or the typical verification command RLS policy test with two different tenant sessions + data leakage check. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Multi-Tenant Data Isolation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Measure using RLS policy test with two different tenant sessions + data leakage check. Guard against: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:tune",
          "optimization",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_api_routes_tune",
      "title": "Next.js API Routes & Route Handlers: Tune",
      "description": "[Next.js API Routes & Route Handlers] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "trigger": "Optimize \"Next.js API Routes & Route Handlers\". Target the failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\" or the typical verification command curl --verbose + API route error log + status code audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Next.js API Routes & Route Handlers. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is route.ts handler / server action / API client wrapper / error boundary. Measure using curl --verbose + API route error log + status code audit. Guard against: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:tune",
          "optimization",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_data_fetching_tune",
      "title": "Next.js Data Fetching Patterns: Tune",
      "description": "[Next.js Data Fetching Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "trigger": "Optimize \"Next.js Data Fetching Patterns\". Target the failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\" or the typical verification command next build --debug + React DevTools fetch profiling. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Next.js Data Fetching Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is server fetch / React cache wrapper / streaming suspense boundary. Measure using next build --debug + React DevTools fetch profiling. Guard against: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:tune",
          "optimization",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_middleware_tune",
      "title": "Next.js Middleware & Edge Runtime: Tune",
      "description": "[Next.js Middleware & Edge Runtime] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "trigger": "Optimize \"Next.js Middleware & Edge Runtime\". Target the failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\" or the typical verification command next dev + curl --cookie tests + edge runtime log inspection. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Next.js Middleware & Edge Runtime. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Measure using next dev + curl --cookie tests + edge runtime log inspection. Guard against: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:nextjs-middleware",
          "workflow:tune",
          "optimization",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_error_handling_tune",
      "title": "Node.js Error Handling & Resilience: Tune",
      "description": "[Node.js Error Handling & Resilience] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "trigger": "Optimize \"Node.js Error Handling & Resilience\". Target the failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\" or the typical verification command node --unhandled-rejections=strict + process.on('uncaughtException') log. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Node.js Error Handling & Resilience. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is global error handler / async wrapper / structured error response / retry logic. Measure using node --unhandled-rejections=strict + process.on('uncaughtException') log. Guard against: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-error-handling",
          "workflow:tune",
          "optimization",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_streams_tune",
      "title": "Node.js Streams & Backpressure: Tune",
      "description": "[Node.js Streams & Backpressure] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "trigger": "Optimize \"Node.js Streams & Backpressure\". Target the failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\" or the typical verification command Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Node.js Streams & Backpressure. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is Readable/Writable stream / Transform / pipeline() refactor. Measure using Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Guard against: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:node-streams",
          "workflow:tune",
          "optimization",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "oauth_flows_tune",
      "title": "OAuth 2.0 Flows & Token Management: Tune",
      "description": "[OAuth 2.0 Flows & Token Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "trigger": "Optimize \"OAuth 2.0 Flows & Token Management\". Target the failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\" or the typical verification command oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising OAuth 2.0 Flows & Token Management. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Measure using oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Guard against: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:oauth-flows",
          "workflow:tune",
          "optimization",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "openapi_spec_tune",
      "title": "OpenAPI Specification & Validation: Tune",
      "description": "[OpenAPI Specification & Validation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "trigger": "Optimize \"OpenAPI Specification & Validation\". Target the failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\" or the typical verification command redocly lint + openapi-diff + swagger-ui preview. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising OpenAPI Specification & Validation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is openapi.yaml / code-first generator / request/response validation middleware. Measure using redocly lint + openapi-diff + swagger-ui preview. Guard against: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:openapi-spec",
          "workflow:tune",
          "optimization",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "playwright_selectors_tune",
      "title": "Playwright Selectors & Locators: Tune",
      "description": "[Playwright Selectors & Locators] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "trigger": "Optimize \"Playwright Selectors & Locators\". Target the failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\" or the typical verification command playwright test --reporter=html + playwright codegen + trace viewer. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Playwright Selectors & Locators. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Measure using playwright test --reporter=html + playwright codegen + trace viewer. Guard against: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:playwright-selectors",
          "workflow:tune",
          "optimization",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "prompt_injection_defense_tune",
      "title": "Prompt Injection Defense: Tune",
      "description": "[Prompt Injection Defense] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "trigger": "Optimize \"Prompt Injection Defense\". Target the failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\" or the typical verification command prompt injection test suite + adversarial input fuzzing + output scanner. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Prompt Injection Defense. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is defensive system prompt / input sanitizer / instruction guardrail / output validator. Measure using prompt injection test suite + adversarial input fuzzing + output scanner. Guard against: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:tune",
          "optimization",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_async_tune",
      "title": "Python Async/Await Patterns: Tune",
      "description": "[Python Async/Await Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "trigger": "Optimize \"Python Async/Await Patterns\". Target the failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\" or the typical verification command python3 -m asyncio + aiohttp/httpx async benchmark. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Python Async/Await Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is async/await refactor / asyncio.gather / async context manager. Measure using python3 -m asyncio + aiohttp/httpx async benchmark. Guard against: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-async",
          "workflow:tune",
          "optimization",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_file_io_tune",
      "title": "Python File I/O & Encoding: Tune",
      "description": "[Python File I/O & Encoding] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "trigger": "Optimize \"Python File I/O & Encoding\". Target the failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\" or the typical verification command python3 -c with open() + chardet encoding detection. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Python File I/O & Encoding. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is pathlib refactor / encoding-safe file reader / batch file processor. Measure using python3 -c with open() + chardet encoding detection. Guard against: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:python-file-io",
          "workflow:tune",
          "optimization",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rag_chunking_tune",
      "title": "RAG Chunking Strategies: Tune",
      "description": "[RAG Chunking Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "trigger": "Optimize \"RAG Chunking Strategies\". Target the failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\" or the typical verification command retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising RAG Chunking Strategies. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Measure using retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Guard against: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rag-chunking",
          "workflow:tune",
          "optimization",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rate_limiting_proxy_tune",
      "title": "Rate Limiting & API Gateway Proxy: Tune",
      "description": "[Rate Limiting & API Gateway Proxy] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "trigger": "Optimize \"Rate Limiting & API Gateway Proxy\". Target the failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\" or the typical verification command ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Rate Limiting & API Gateway Proxy. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Measure using ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Guard against: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:tune",
          "optimization",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_server_components_tune",
      "title": "React Server Components: Tune",
      "description": "[React Server Components] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "trigger": "Optimize \"React Server Components\". Target the failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\" or the typical verification command next build --debug + React Server Components lint rule. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising React Server Components. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is server component / client boundary refactor / streaming fallback. Measure using next build --debug + React Server Components lint rule. Guard against: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-server-components",
          "workflow:tune",
          "optimization",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_state_tune",
      "title": "React State Management: Tune",
      "description": "[React State Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "trigger": "Optimize \"React State Management\". Target the failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\" or the typical verification command React DevTools profiler + why-did-you-render. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising React State Management. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Measure using React DevTools profiler + why-did-you-render. Guard against: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:react-state",
          "workflow:tune",
          "optimization",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "redis_caching_tune",
      "title": "Redis Caching Strategies: Tune",
      "description": "[Redis Caching Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "trigger": "Optimize \"Redis Caching Strategies\". Target the failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\" or the typical verification command redis-cli --stat + cache hit ratio monitoring + slow log. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Redis Caching Strategies. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Measure using redis-cli --stat + cache hit ratio monitoring + slow log. Guard against: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:redis-caching",
          "workflow:tune",
          "optimization",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rest_pagination_tune",
      "title": "REST Pagination Design: Tune",
      "description": "[REST Pagination Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "trigger": "Optimize \"REST Pagination Design\". Target the failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\" or the typical verification command curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising REST Pagination Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Measure using curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Guard against: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:rest-pagination",
          "workflow:tune",
          "optimization",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "secrets_rotation_tune",
      "title": "Secrets Rotation Policy: Tune",
      "description": "[Secrets Rotation Policy] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "trigger": "Optimize \"Secrets Rotation Policy\". Target the failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\" or the typical verification command vault lease list + secret expiry check + rotation dry-run test. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Secrets Rotation Policy. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is rotation script / vault integration / lease management / incident response plan. Measure using vault lease list + secret expiry check + rotation dry-run test. Guard against: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:secrets-rotation",
          "workflow:tune",
          "optimization",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "shell_script_robustness_tune",
      "title": "Shell Script Robustness & Safety: Tune",
      "description": "[Shell Script Robustness & Safety] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "trigger": "Optimize \"Shell Script Robustness & Safety\". Target the failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\" or the typical verification command shellcheck script.sh + bash -n script.sh + dry-run mode test. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Shell Script Robustness & Safety. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Measure using shellcheck script.sh + bash -n script.sh + dry-run mode test. Guard against: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:shell-script-robustness",
          "workflow:tune",
          "optimization",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "sql_query_optimization_tune",
      "title": "SQL Query Optimisation: Tune",
      "description": "[SQL Query Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "trigger": "Optimize \"SQL Query Optimisation\". Target the failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\" or the typical verification command EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising SQL Query Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Measure using EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Guard against: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:sql-query-optimization",
          "workflow:tune",
          "optimization",
          "sql",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stealth_web_research_tune",
      "title": "Stealth Web Research & Harvesting: Tune",
      "description": "[Stealth Web Research & Harvesting] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "trigger": "Optimize \"Stealth Web Research & Harvesting\". Target the failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\" or the typical verification command playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Stealth Web Research & Harvesting. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Measure using playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Guard against: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stealth-web-research",
          "workflow:tune",
          "optimization",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stripe_webhook_idempotency_tune",
      "title": "Stripe Webhook Idempotency: Tune",
      "description": "[Stripe Webhook Idempotency] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "trigger": "Optimize \"Stripe Webhook Idempotency\". Target the failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\" or the typical verification command stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Stripe Webhook Idempotency. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Measure using stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Guard against: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:tune",
          "optimization",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "supabase_rls_tune",
      "title": "Supabase Row-Level Security: Tune",
      "description": "[Supabase Row-Level Security] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "trigger": "Optimize \"Supabase Row-Level Security\". Target the failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\" or the typical verification command supabase db check + supabase db test + RLS policy review with pg_policies. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Supabase Row-Level Security. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is RLS policy / policy test / security definer function / admin bypass. Measure using supabase db check + supabase db test + RLS policy review with pg_policies. Guard against: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:supabase-rls",
          "workflow:tune",
          "optimization",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "terraform_state_tune",
      "title": "Terraform State Management: Tune",
      "description": "[Terraform State Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "trigger": "Optimize \"Terraform State Management\". Target the failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\" or the typical verification command terraform plan + terraform state list + terraform state pull | jq. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Terraform State Management. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is backend config / state migration plan / state locking config / remote state datasource. Measure using terraform plan + terraform state list + terraform state pull | jq. Guard against: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:terraform-state",
          "workflow:tune",
          "optimization",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "typescript_generics_tune",
      "title": "TypeScript Generics & Advanced Types: Tune",
      "description": "[TypeScript Generics & Advanced Types] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "trigger": "Optimize \"TypeScript Generics & Advanced Types\". Target the failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\" or the typical verification command tsc --noEmit --strict + type tests with expect-type. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising TypeScript Generics & Advanced Types. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is generic type / conditional type / mapped type / branded type. Measure using tsc --noEmit --strict + type tests with expect-type. Guard against: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:typescript-generics",
          "workflow:tune",
          "optimization",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "user_onboarding_flow_tune",
      "title": "User Onboarding Flow Design: Tune",
      "description": "[User Onboarding Flow Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "trigger": "Optimize \"User Onboarding Flow Design\". Target the failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\" or the typical verification command analytics funnel analysis + onboarding completion rate + drop-off heatmap. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising User Onboarding Flow Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Measure using analytics funnel analysis + onboarding completion rate + drop-off heatmap. Guard against: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:tune",
          "optimization",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "vercel_env_vars_tune",
      "title": "Vercel Environment Variables: Tune",
      "description": "[Vercel Environment Variables] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "trigger": "Optimize \"Vercel Environment Variables\". Target the failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\" or the typical verification command vercel env pull + vercel list + project settings audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Vercel Environment Variables. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is vercel.json env group / preview env config / Edge Config / KV store. Measure using vercel env pull + vercel list + project settings audit. Guard against: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:vercel-env-vars",
          "workflow:tune",
          "optimization",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_scraping_ethics_tune",
      "title": "Web Scraping Ethics & Compliance: Tune",
      "description": "[Web Scraping Ethics & Compliance] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "trigger": "Optimize \"Web Scraping Ethics & Compliance\". Target the failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\" or the typical verification command curl robots.txt + wget --wait + scraper log audit. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Web Scraping Ethics & Compliance. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Measure using curl robots.txt + wget --wait + scraper log audit. Guard against: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:tune",
          "optimization",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "websocket_reconnection_tune",
      "title": "WebSocket Reconnection Strategies: Tune",
      "description": "[WebSocket Reconnection Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "trigger": "Optimize \"WebSocket Reconnection Strategies\". Target the failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\" or the typical verification command Browser DevTools Network tab WS filter + reconnection test with server restart. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising WebSocket Reconnection Strategies. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is WebSocket client / reconnection logic / heartbeat / connection status component. Measure using Browser DevTools Network tab WS filter + reconnection test with server restart. Guard against: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:websocket-reconnection",
          "workflow:tune",
          "optimization",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_vitals_optimization_tune",
      "title": "Web Vitals Optimisation (LCP/CLS/INP): Tune",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "trigger": "Optimize \"Web Vitals Optimisation (LCP/CLS/INP)\". Target the failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\" or the typical verification command Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Benchmark before and after. Prefer non-breaking optimisations.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are optimising Web Vitals Optimisation (LCP/CLS/INP). Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Measure using Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Guard against: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Report before/after values.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:tune",
          "optimization",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "intent_router",
      "title": "Intent Router",
      "description": "Analyses a user request, determines the most appropriate skill to invoke, and produces a ranked execution plan. Prevents unnecessary agent context switching by grouping related sub-tasks under a single skill.",
      "trigger": "Call this when a user request is vague, multi-layered, or when you are unsure which specialised skill applies.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "Read the full request. Identify the primary intent (create, debug, refactor, document, secure, optimise). Determine the target layer (frontend, backend, data, infra, AI, docs). Choose the single best matching skill slug. Explain the choice in one sentence. If multiple skills could apply, rank them and output a sequence. Never default to asking clarifying questions if a safe fallback exists.",
      "metadata": {
        "risk": "low",
        "tags": [
          "router",
          "orchestration",
          "classification"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a_b_testing_framework_plan",
      "title": "A/B Testing Framework: Plan",
      "description": "[A/B Testing Framework] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "trigger": "A change to \"A/B Testing Framework\" needs to be designed first. Consider the common failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\" and the best practice \"Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for A/B Testing Framework. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. The output artifact is experiment spec / variant assignment / metric definition / statistical analysis script. Consider the failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:plan",
          "planning",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a11y_aria_patterns_plan",
      "title": "Accessibility ARIA Patterns: Plan",
      "description": "[Accessibility ARIA Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "trigger": "A change to \"Accessibility ARIA Patterns\" needs to be designed first. Consider the common failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\" and the best practice \"Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Accessibility ARIA Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. The output artifact is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Consider the failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:plan",
          "planning",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "agent_tool_binding_plan",
      "title": "Agent Tool Binding & Dispatch: Plan",
      "description": "[Agent Tool Binding & Dispatch] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "trigger": "A change to \"Agent Tool Binding & Dispatch\" needs to be designed first. Consider the common failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\" and the best practice \"Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Agent Tool Binding & Dispatch. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. The output artifact is router tool / domain group / dynamic tool injection / tool usage statistics. Consider the failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:agent-tool-binding",
          "workflow:plan",
          "planning",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "analytics_metric_definition_plan",
      "title": "Analytics Metric Definitions: Plan",
      "description": "[Analytics Metric Definitions] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "trigger": "A change to \"Analytics Metric Definitions\" needs to be designed first. Consider the common failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\" and the best practice \"Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Analytics Metric Definitions. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. The output artifact is metric definition / dbt model / SQL logic / dashboard tile / documentation. Consider the failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:plan",
          "planning",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "adr_documentation_plan",
      "title": "Architecture Decision Records: Plan",
      "description": "[Architecture Decision Records] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "trigger": "A change to \"Architecture Decision Records\" needs to be designed first. Consider the common failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\" and the best practice \"Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ADR document / decision log / template / review workflow this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Architecture Decision Records. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. The output artifact is ADR document / decision log / template / review workflow. Consider the failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:adr-documentation",
          "workflow:plan",
          "planning",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "aws_lambda_cold_start_plan",
      "title": "AWS Lambda Cold Starts: Plan",
      "description": "[AWS Lambda Cold Starts] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "trigger": "A change to \"AWS Lambda Cold Starts\" needs to be designed first. Consider the common failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\" and the best practice \"Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for AWS Lambda Cold Starts. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. The output artifact is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Consider the failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:plan",
          "planning",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "azure_bicep_plan",
      "title": "Azure Bicep Infrastructure: Plan",
      "description": "[Azure Bicep Infrastructure] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "trigger": "A change to \"Azure Bicep Infrastructure\" needs to be designed first. Consider the common failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\" and the best practice \"Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific main.bicep / module / parameter file / azd template this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Azure Bicep Infrastructure. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. The output artifact is main.bicep / module / parameter file / azd template. Consider the failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:azure-bicep",
          "workflow:plan",
          "planning",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "browser_devtools_plan",
      "title": "Browser DevTools & Debugging: Plan",
      "description": "[Browser DevTools & Debugging] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "trigger": "A change to \"Browser DevTools & Debugging\" needs to be designed first. Consider the common failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\" and the best practice \"Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Browser DevTools & Debugging. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. The output artifact is debugging workflow / breakpoint guide / performance recording / memory snapshot. Consider the failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:browser-devtools",
          "workflow:plan",
          "planning",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cli_tool_design_plan",
      "title": "CLI Tool Design Patterns: Plan",
      "description": "[CLI Tool Design Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "trigger": "A change to \"CLI Tool Design Patterns\" needs to be designed first. Consider the common failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\" and the best practice \"Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for CLI Tool Design Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. The output artifact is CLI scaffolding / argument parser / exit code handler / --json output mode. Consider the failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cli-tool-design",
          "workflow:plan",
          "planning",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cloud_cost_optimization_plan",
      "title": "Cloud Cost Optimisation: Plan",
      "description": "[Cloud Cost Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "trigger": "A change to \"Cloud Cost Optimisation\" needs to be designed first. Consider the common failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\" and the best practice \"Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Cloud Cost Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. The output artifact is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Consider the failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:plan",
          "planning",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "code_review_checklist_plan",
      "title": "Code Review Checklist: Plan",
      "description": "[Code Review Checklist] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "trigger": "A change to \"Code Review Checklist\" needs to be designed first. Consider the common failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\" and the best practice \"Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Code Review Checklist. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. The output artifact is review checklist / automated review comment / risk classification / diff summary. Consider the failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:code-review-checklist",
          "workflow:plan",
          "planning",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "convex_functions_plan",
      "title": "Convex Functions & Mutations: Plan",
      "description": "[Convex Functions & Mutations] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "trigger": "A change to \"Convex Functions & Mutations\" needs to be designed first. Consider the common failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\" and the best practice \"Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific mutation / query / action / component / scheduler job this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Convex Functions & Mutations. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. The output artifact is mutation / query / action / component / scheduler job. Consider the failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:convex-functions",
          "workflow:plan",
          "planning",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cron_job_reliability_plan",
      "title": "Cron Job & Scheduled Task Reliability: Plan",
      "description": "[Cron Job & Scheduled Task Reliability] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "trigger": "A change to \"Cron Job & Scheduled Task Reliability\" needs to be designed first. Consider the common failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\" and the best practice \"Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Cron Job & Scheduled Task Reliability. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. The output artifact is crontab entry / log rotation / idempotency guard / failure alert integration. Consider the failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:cron-job-reliability",
          "workflow:plan",
          "planning",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "css_layout_plan",
      "title": "CSS Layout & Responsiveness: Plan",
      "description": "[CSS Layout & Responsiveness] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "trigger": "A change to \"CSS Layout & Responsiveness\" needs to be designed first. Consider the common failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\" and the best practice \"Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for CSS Layout & Responsiveness. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. The output artifact is CSS layout refactor / responsive grid / container query implementation. Consider the failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:css-layout",
          "workflow:plan",
          "planning",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "csv_data_cleaning_plan",
      "title": "CSV Data Cleaning Pipeline: Plan",
      "description": "[CSV Data Cleaning Pipeline] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "trigger": "A change to \"CSV Data Cleaning Pipeline\" needs to be designed first. Consider the common failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\" and the best practice \"Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for CSV Data Cleaning Pipeline. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. The output artifact is CSV parser / row validator / column type mapper / error report / cleaned output. Consider the failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:plan",
          "planning",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "database_migration_safety_plan",
      "title": "Database Migration Safety: Plan",
      "description": "[Database Migration Safety] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "trigger": "A change to \"Database Migration Safety\" needs to be designed first. Consider the common failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\" and the best practice \"Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Database Migration Safety. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. The output artifact is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Consider the failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:database-migration-safety",
          "workflow:plan",
          "planning",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "data_warehouse_schema_plan",
      "title": "Data Warehouse Schema Design: Plan",
      "description": "[Data Warehouse Schema Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "trigger": "A change to \"Data Warehouse Schema Design\" needs to be designed first. Consider the common failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\" and the best practice \"Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Data Warehouse Schema Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. The output artifact is star schema / fact table / dimension table / ETL pipeline spec. Consider the failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:plan",
          "planning",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "design_token_system_plan",
      "title": "Design Token Systems: Plan",
      "description": "[Design Token Systems] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "trigger": "A change to \"Design Token Systems\" needs to be designed first. Consider the common failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\" and the best practice \"Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Design Token Systems. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. The output artifact is token JSON / CSS custom properties / theme switcher / token documentation. Consider the failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:design-token-system",
          "workflow:plan",
          "planning",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_compose_networking_plan",
      "title": "Docker Compose Networking: Plan",
      "description": "[Docker Compose Networking] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "trigger": "A change to \"Docker Compose Networking\" needs to be designed first. Consider the common failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\" and the best practice \"All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Docker Compose Networking. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. The output artifact is docker-compose.yml / network config / healthcheck / depends_on condition. Consider the failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-compose-networking",
          "workflow:plan",
          "planning",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_multistage_plan",
      "title": "Docker Multi-Stage Builds: Plan",
      "description": "[Docker Multi-Stage Builds] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "trigger": "A change to \"Docker Multi-Stage Builds\" needs to be designed first. Consider the common failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\" and the best practice \"Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Docker Multi-Stage Builds. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. The output artifact is multi-stage Dockerfile / .dockerignore / slim base image switch. Consider the failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:docker-multistage",
          "workflow:plan",
          "planning",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "drizzle_schema_design_plan",
      "title": "Drizzle Schema Design: Plan",
      "description": "[Drizzle Schema Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "trigger": "A change to \"Drizzle Schema Design\" needs to be designed first. Consider the common failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\" and the best practice \"Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Drizzle Schema Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. The output artifact is schema.ts / relation map / migration SQL / Drizzle query builder. Consider the failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:plan",
          "planning",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "error_monitoring_setup_plan",
      "title": "Error Monitoring & Alerting Setup: Plan",
      "description": "[Error Monitoring & Alerting Setup] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "trigger": "A change to \"Error Monitoring & Alerting Setup\" needs to be designed first. Consider the common failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\" and the best practice \"Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Error Monitoring & Alerting Setup. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. The output artifact is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Consider the failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:plan",
          "planning",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "fastapi_dependencies_plan",
      "title": "FastAPI Dependency Injection: Plan",
      "description": "[FastAPI Dependency Injection] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "trigger": "A change to \"FastAPI Dependency Injection\" needs to be designed first. Consider the common failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\" and the best practice \"Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific dependency / lifespan handler / override for testing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for FastAPI Dependency Injection. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. The output artifact is dependency / lifespan handler / override for testing. Consider the failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:plan",
          "planning",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "feature_flags_plan",
      "title": "Feature Flags & Gradual Rollouts: Plan",
      "description": "[Feature Flags & Gradual Rollouts] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "trigger": "A change to \"Feature Flags & Gradual Rollouts\" needs to be designed first. Consider the common failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\" and the best practice \"Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Feature Flags & Gradual Rollouts. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. The output artifact is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Consider the failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:feature-flags",
          "workflow:plan",
          "planning",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "git_conflict_resolution_plan",
      "title": "Git Conflict Resolution: Plan",
      "description": "[Git Conflict Resolution] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "trigger": "A change to \"Git Conflict Resolution\" needs to be designed first. Consider the common failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\" and the best practice \"For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Git Conflict Resolution. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. The output artifact is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Consider the failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:plan",
          "planning",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "github_actions_pipeline_plan",
      "title": "GitHub Actions Pipeline Optimisation: Plan",
      "description": "[GitHub Actions Pipeline Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "trigger": "A change to \"GitHub Actions Pipeline Optimisation\" needs to be designed first. Consider the common failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\" and the best practice \"Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for GitHub Actions Pipeline Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. The output artifact is workflow YAML / cache config / matrix build / conditional job execution. Consider the failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:plan",
          "planning",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "graphql_n_plus_one_plan",
      "title": "GraphQL N+1 Query Prevention: Plan",
      "description": "[GraphQL N+1 Query Prevention] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "trigger": "A change to \"GraphQL N+1 Query Prevention\" needs to be designed first. Consider the common failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\" and the best practice \"Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for GraphQL N+1 Query Prevention. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. The output artifact is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Consider the failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:plan",
          "planning",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "jest_test_optimization_plan",
      "title": "Jest Test Optimisation: Plan",
      "description": "[Jest Test Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "trigger": "A change to \"Jest Test Optimisation\" needs to be designed first. Consider the common failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\" and the best practice \"Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Jest Test Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. The output artifact is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Consider the failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:jest-test-optimization",
          "workflow:plan",
          "planning",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "json_schema_validation_plan",
      "title": "JSON Schema Validation: Plan",
      "description": "[JSON Schema Validation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "trigger": "A change to \"JSON Schema Validation\" needs to be designed first. Consider the common failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\" and the best practice \"Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for JSON Schema Validation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. The output artifact is JSON Schema / validator middleware / type guard / error message / response parser. Consider the failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:json-schema-validation",
          "workflow:plan",
          "planning",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_hpa_plan",
      "title": "Kubernetes Horizontal Pod Autoscaling: Plan",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "trigger": "A change to \"Kubernetes Horizontal Pod Autoscaling\" needs to be designed first. Consider the common failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\" and the best practice \"Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Kubernetes Horizontal Pod Autoscaling. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. The output artifact is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Consider the failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:plan",
          "planning",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_pod_lifecycle_plan",
      "title": "Kubernetes Pod Lifecycle: Plan",
      "description": "[Kubernetes Pod Lifecycle] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "trigger": "A change to \"Kubernetes Pod Lifecycle\" needs to be designed first. Consider the common failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\" and the best practice \"Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Kubernetes Pod Lifecycle. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. The output artifact is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Consider the failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:plan",
          "planning",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "context_window_budget_plan",
      "title": "LLM Context Window Budget Management: Plan",
      "description": "[LLM Context Window Budget Management] Design a change with explicit assumptions, success criteria, and rollback instructions Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "trigger": "A change to \"LLM Context Window Budget Management\" needs to be designed first. Consider the common failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\" and the best practice \"Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "json",
          "name": "json",
          "description": "JSON output"
        },
        {
          "kind": "checklist",
          "name": "chk",
          "description": "CHK output"
        }
      ],
      "promptTemplate": "You are designing a plan for LLM Context Window Budget Management. Design a change with explicit assumptions, success criteria, and rollback instructions. Reference the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. The output artifact is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Consider the failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:context-window-budget",
          "workflow:plan",
          "planning",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "mcp_tool_design_plan",
      "title": "MCP Tool Design & Best Practices: Plan",
      "description": "[MCP Tool Design & Best Practices] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "trigger": "A change to \"MCP Tool Design & Best Practices\" needs to be designed first. Consider the common failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\" and the best practice \"Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for MCP Tool Design & Best Practices. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. The output artifact is MCP tool descriptor / resource definition / prompt template / server metadata. Consider the failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:mcp-tool-design",
          "workflow:plan",
          "planning",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "message_queues_plan",
      "title": "Message Queues & Background Jobs: Plan",
      "description": "[Message Queues & Background Jobs] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "trigger": "A change to \"Message Queues & Background Jobs\" needs to be designed first. Consider the common failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\" and the best practice \"Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Message Queues & Background Jobs. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. The output artifact is queue producer / worker / dead-letter handler / retry policy. Consider the failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:message-queues",
          "workflow:plan",
          "planning",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "multi_tenant_isolation_plan",
      "title": "Multi-Tenant Data Isolation: Plan",
      "description": "[Multi-Tenant Data Isolation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "trigger": "A change to \"Multi-Tenant Data Isolation\" needs to be designed first. Consider the common failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\" and the best practice \"Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Multi-Tenant Data Isolation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. The output artifact is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Consider the failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:plan",
          "planning",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_api_routes_plan",
      "title": "Next.js API Routes & Route Handlers: Plan",
      "description": "[Next.js API Routes & Route Handlers] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "trigger": "A change to \"Next.js API Routes & Route Handlers\" needs to be designed first. Consider the common failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\" and the best practice \"All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Next.js API Routes & Route Handlers. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. The output artifact is route.ts handler / server action / API client wrapper / error boundary. Consider the failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:plan",
          "planning",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_data_fetching_plan",
      "title": "Next.js Data Fetching Patterns: Plan",
      "description": "[Next.js Data Fetching Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "trigger": "A change to \"Next.js Data Fetching Patterns\" needs to be designed first. Consider the common failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\" and the best practice \"Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Next.js Data Fetching Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. The output artifact is server fetch / React cache wrapper / streaming suspense boundary. Consider the failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:plan",
          "planning",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_middleware_plan",
      "title": "Next.js Middleware & Edge Runtime: Plan",
      "description": "[Next.js Middleware & Edge Runtime] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "trigger": "A change to \"Next.js Middleware & Edge Runtime\" needs to be designed first. Consider the common failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\" and the best practice \"Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Next.js Middleware & Edge Runtime. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. The output artifact is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Consider the failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:nextjs-middleware",
          "workflow:plan",
          "planning",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_error_handling_plan",
      "title": "Node.js Error Handling & Resilience: Plan",
      "description": "[Node.js Error Handling & Resilience] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "trigger": "A change to \"Node.js Error Handling & Resilience\" needs to be designed first. Consider the common failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\" and the best practice \"Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Node.js Error Handling & Resilience. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. The output artifact is global error handler / async wrapper / structured error response / retry logic. Consider the failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-error-handling",
          "workflow:plan",
          "planning",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_streams_plan",
      "title": "Node.js Streams & Backpressure: Plan",
      "description": "[Node.js Streams & Backpressure] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "trigger": "A change to \"Node.js Streams & Backpressure\" needs to be designed first. Consider the common failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\" and the best practice \"Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Node.js Streams & Backpressure. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. The output artifact is Readable/Writable stream / Transform / pipeline() refactor. Consider the failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:node-streams",
          "workflow:plan",
          "planning",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "oauth_flows_plan",
      "title": "OAuth 2.0 Flows & Token Management: Plan",
      "description": "[OAuth 2.0 Flows & Token Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "trigger": "A change to \"OAuth 2.0 Flows & Token Management\" needs to be designed first. Consider the common failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\" and the best practice \"Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for OAuth 2.0 Flows & Token Management. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. The output artifact is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Consider the failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:oauth-flows",
          "workflow:plan",
          "planning",
          "oauth",
          "auth",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "openapi_spec_plan",
      "title": "OpenAPI Specification & Validation: Plan",
      "description": "[OpenAPI Specification & Validation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "trigger": "A change to \"OpenAPI Specification & Validation\" needs to be designed first. Consider the common failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\" and the best practice \"Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for OpenAPI Specification & Validation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. The output artifact is openapi.yaml / code-first generator / request/response validation middleware. Consider the failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:openapi-spec",
          "workflow:plan",
          "planning",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "playwright_selectors_plan",
      "title": "Playwright Selectors & Locators: Plan",
      "description": "[Playwright Selectors & Locators] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "trigger": "A change to \"Playwright Selectors & Locators\" needs to be designed first. Consider the common failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\" and the best practice \"Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Playwright Selectors & Locators. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. The output artifact is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Consider the failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:playwright-selectors",
          "workflow:plan",
          "planning",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "prompt_injection_defense_plan",
      "title": "Prompt Injection Defense: Plan",
      "description": "[Prompt Injection Defense] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "trigger": "A change to \"Prompt Injection Defense\" needs to be designed first. Consider the common failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\" and the best practice \"Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Prompt Injection Defense. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. The output artifact is defensive system prompt / input sanitizer / instruction guardrail / output validator. Consider the failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:plan",
          "planning",
          "prompt",
          "security",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_async_plan",
      "title": "Python Async/Await Patterns: Plan",
      "description": "[Python Async/Await Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "trigger": "A change to \"Python Async/Await Patterns\" needs to be designed first. Consider the common failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\" and the best practice \"Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Python Async/Await Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. The output artifact is async/await refactor / asyncio.gather / async context manager. Consider the failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-async",
          "workflow:plan",
          "planning",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_file_io_plan",
      "title": "Python File I/O & Encoding: Plan",
      "description": "[Python File I/O & Encoding] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "trigger": "A change to \"Python File I/O & Encoding\" needs to be designed first. Consider the common failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\" and the best practice \"Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Python File I/O & Encoding. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. The output artifact is pathlib refactor / encoding-safe file reader / batch file processor. Consider the failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:python-file-io",
          "workflow:plan",
          "planning",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rag_chunking_plan",
      "title": "RAG Chunking Strategies: Plan",
      "description": "[RAG Chunking Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "trigger": "A change to \"RAG Chunking Strategies\" needs to be designed first. Consider the common failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\" and the best practice \"Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for RAG Chunking Strategies. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. The output artifact is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Consider the failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rag-chunking",
          "workflow:plan",
          "planning",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rate_limiting_proxy_plan",
      "title": "Rate Limiting & API Gateway Proxy: Plan",
      "description": "[Rate Limiting & API Gateway Proxy] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "trigger": "A change to \"Rate Limiting & API Gateway Proxy\" needs to be designed first. Consider the common failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\" and the best practice \"Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Rate Limiting & API Gateway Proxy. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. The output artifact is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Consider the failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:plan",
          "planning",
          "rate-limiting",
          "proxy",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_server_components_plan",
      "title": "React Server Components: Plan",
      "description": "[React Server Components] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "trigger": "A change to \"React Server Components\" needs to be designed first. Consider the common failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\" and the best practice \"Keep data fetching and heavy logic in server components; pass results as props to client islands.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for React Server Components. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. The output artifact is server component / client boundary refactor / streaming fallback. Consider the failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-server-components",
          "workflow:plan",
          "planning",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_state_plan",
      "title": "React State Management: Plan",
      "description": "[React State Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "trigger": "A change to \"React State Management\" needs to be designed first. Consider the common failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\" and the best practice \"Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for React State Management. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. The output artifact is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Consider the failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:react-state",
          "workflow:plan",
          "planning",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "reasoning_architect",
      "title": "Reasoning Architect",
      "description": "Breaks complex, multi-step tasks into a structured plan with explicit assumptions, success criteria, and a minimax strategy: minimal effort for maximum verifiable impact. Every step includes a rollback path.",
      "trigger": "Call this when a task spans multiple systems, is vaguely defined, or carries risk of cascading failures.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "Restate the goal in one sentence. List all implicit assumptions. Define success criteria as concrete, testable outcomes. Decompose into smallest viable steps. For each step: expected output, boundary risk, verification command, and rollback instruction. Optimise for the shortest path to a working increment. If any step requires a decision, present options with trade-offs in a table.",
      "metadata": {
        "risk": "low",
        "tags": [
          "planning",
          "decomposition",
          "risk-management"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "redis_caching_plan",
      "title": "Redis Caching Strategies: Plan",
      "description": "[Redis Caching Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "trigger": "A change to \"Redis Caching Strategies\" needs to be designed first. Consider the common failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\" and the best practice \"Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Redis Caching Strategies. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. The output artifact is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Consider the failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:redis-caching",
          "workflow:plan",
          "planning",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rest_pagination_plan",
      "title": "REST Pagination Design: Plan",
      "description": "[REST Pagination Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "trigger": "A change to \"REST Pagination Design\" needs to be designed first. Consider the common failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\" and the best practice \"Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for REST Pagination Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. The output artifact is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Consider the failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:rest-pagination",
          "workflow:plan",
          "planning",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "secrets_rotation_plan",
      "title": "Secrets Rotation Policy: Plan",
      "description": "[Secrets Rotation Policy] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "trigger": "A change to \"Secrets Rotation Policy\" needs to be designed first. Consider the common failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\" and the best practice \"Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Secrets Rotation Policy. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. The output artifact is rotation script / vault integration / lease management / incident response plan. Consider the failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:secrets-rotation",
          "workflow:plan",
          "planning",
          "secrets",
          "security",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "shell_script_robustness_plan",
      "title": "Shell Script Robustness & Safety: Plan",
      "description": "[Shell Script Robustness & Safety] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "trigger": "A change to \"Shell Script Robustness & Safety\" needs to be designed first. Consider the common failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\" and the best practice \"Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Shell Script Robustness & Safety. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. The output artifact is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Consider the failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:shell-script-robustness",
          "workflow:plan",
          "planning",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "sql_query_optimization_plan",
      "title": "SQL Query Optimisation: Plan",
      "description": "[SQL Query Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "trigger": "A change to \"SQL Query Optimisation\" needs to be designed first. Consider the common failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\" and the best practice \"Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for SQL Query Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. The output artifact is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Consider the failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:sql-query-optimization",
          "workflow:plan",
          "planning",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stealth_web_research_plan",
      "title": "Stealth Web Research & Harvesting: Plan",
      "description": "[Stealth Web Research & Harvesting] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "trigger": "A change to \"Stealth Web Research & Harvesting\" needs to be designed first. Consider the common failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\" and the best practice \"Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Stealth Web Research & Harvesting. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. The output artifact is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Consider the failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stealth-web-research",
          "workflow:plan",
          "planning",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stripe_webhook_idempotency_plan",
      "title": "Stripe Webhook Idempotency: Plan",
      "description": "[Stripe Webhook Idempotency] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "trigger": "A change to \"Stripe Webhook Idempotency\" needs to be designed first. Consider the common failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\" and the best practice \"Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Stripe Webhook Idempotency. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. The output artifact is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Consider the failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:plan",
          "planning",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "supabase_rls_plan",
      "title": "Supabase Row-Level Security: Plan",
      "description": "[Supabase Row-Level Security] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "trigger": "A change to \"Supabase Row-Level Security\" needs to be designed first. Consider the common failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\" and the best practice \"Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Supabase Row-Level Security. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. The output artifact is RLS policy / policy test / security definer function / admin bypass. Consider the failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:supabase-rls",
          "workflow:plan",
          "planning",
          "supabase",
          "rls",
          "security"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "terraform_state_plan",
      "title": "Terraform State Management: Plan",
      "description": "[Terraform State Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "trigger": "A change to \"Terraform State Management\" needs to be designed first. Consider the common failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\" and the best practice \"Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Terraform State Management. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. The output artifact is backend config / state migration plan / state locking config / remote state datasource. Consider the failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:terraform-state",
          "workflow:plan",
          "planning",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "typescript_generics_plan",
      "title": "TypeScript Generics & Advanced Types: Plan",
      "description": "[TypeScript Generics & Advanced Types] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "trigger": "A change to \"TypeScript Generics & Advanced Types\" needs to be designed first. Consider the common failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\" and the best practice \"Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for TypeScript Generics & Advanced Types. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. The output artifact is generic type / conditional type / mapped type / branded type. Consider the failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice). and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:typescript-generics",
          "workflow:plan",
          "planning",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "user_onboarding_flow_plan",
      "title": "User Onboarding Flow Design: Plan",
      "description": "[User Onboarding Flow Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "trigger": "A change to \"User Onboarding Flow Design\" needs to be designed first. Consider the common failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\" and the best practice \"Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for User Onboarding Flow Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. The output artifact is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Consider the failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:plan",
          "planning",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "vercel_env_vars_plan",
      "title": "Vercel Environment Variables: Plan",
      "description": "[Vercel Environment Variables] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "trigger": "A change to \"Vercel Environment Variables\" needs to be designed first. Consider the common failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\" and the best practice \"Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Vercel Environment Variables. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. The output artifact is vercel.json env group / preview env config / Edge Config / KV store. Consider the failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:vercel-env-vars",
          "workflow:plan",
          "planning",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_scraping_ethics_plan",
      "title": "Web Scraping Ethics & Compliance: Plan",
      "description": "[Web Scraping Ethics & Compliance] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "trigger": "A change to \"Web Scraping Ethics & Compliance\" needs to be designed first. Consider the common failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\" and the best practice \"Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Web Scraping Ethics & Compliance. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. The output artifact is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Consider the failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:plan",
          "planning",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "websocket_reconnection_plan",
      "title": "WebSocket Reconnection Strategies: Plan",
      "description": "[WebSocket Reconnection Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "trigger": "A change to \"WebSocket Reconnection Strategies\" needs to be designed first. Consider the common failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\" and the best practice \"Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for WebSocket Reconnection Strategies. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. The output artifact is WebSocket client / reconnection logic / heartbeat / connection status component. Consider the failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state. and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:websocket-reconnection",
          "workflow:plan",
          "planning",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_vitals_optimization_plan",
      "title": "Web Vitals Optimisation (LCP/CLS/INP): Plan",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "trigger": "A change to \"Web Vitals Optimisation (LCP/CLS/INP)\" needs to be designed first. Consider the common failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\" and the best practice \"Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.\". Produce a plan before writing any code.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are designing a plan for Web Vitals Optimisation (LCP/CLS/INP). Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. The output artifact is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Consider the failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions). and propose mitigations.",
      "metadata": {
        "risk": "low",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:plan",
          "planning",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "incident_debugger",
      "title": "Incident Debugger",
      "description": "Systematically isolates the root cause of a failure by separating symptoms from causes, generating minimal hypotheses, and testing them one at a time with minimal code changes.",
      "trigger": "Call this when a build fails, a test fails, an API returns an unexpected status, or a runtime error occurs.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "log": {
            "type": "string",
            "description": "Error log, stack trace, or failure description."
          }
        },
        "required": [
          "goal",
          "log"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "response",
          "description": "Structured markdown response."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "Read the error output. Identify the first concrete error line (file, line number, and error code). Separate the symptom (what the user sees) from the root cause (the underlying code or configuration issue). Generate up to three minimal-fix hypotheses, ordered by likelihood. For each hypothesis, write a single verification command (type-check a specific file, curl a single endpoint, run one test). Execute hypotheses one at a time. After finding the fix, run the full verification-runner sequence.",
      "metadata": {
        "risk": "medium",
        "tags": [
          "debugging",
          "root-cause",
          "triage"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "verification_runner",
      "title": "Verification Runner",
      "description": "Defines and executes a standard post-change verification sequence: type-check → lint → unit tests → build → smoke tests. Adjusts rigour based on change risk level.",
      "trigger": "Call this after completing any code change to confirm nothing is broken.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "command",
          "name": "commands",
          "description": "Safe execution, verification or automation commands."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "Assess the change risk: low (comments, config, docs), medium (new function, refactor within a file), high (schema change, dependency upgrade, public API change). Based on risk, select verification steps from: (1) type-check, (2) lint, (3) affected unit tests, (4) full test suite, (5) build, (6) smoke test (curl endpoints, load page). For each step provide the exact command, expected outcome, and where to look on failure. Execute the sequence and report pass/fail per step.",
      "metadata": {
        "risk": "low",
        "tags": [
          "verification",
          "quality",
          "ci-simulation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a_b_testing_framework_harden",
      "title": "A/B Testing Framework: Harden",
      "description": "[A/B Testing Framework] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..",
      "trigger": "Audit and harden \"A/B Testing Framework\". The common failure pattern \"Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.\" may be present. Follow the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening A/B Testing Framework. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Apply the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:a-b-testing-framework",
          "workflow:harden",
          "security",
          "ab-testing",
          "experiments",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "a11y_aria_patterns_harden",
      "title": "Accessibility ARIA Patterns: Harden",
      "description": "[Accessibility ARIA Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..",
      "trigger": "Audit and harden \"Accessibility ARIA Patterns\". The common failure pattern \"Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.\" may be present. Follow the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Accessibility ARIA Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Apply the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:a11y-aria-patterns",
          "workflow:harden",
          "security",
          "accessibility",
          "aria",
          "testing"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "agent_tool_binding_harden",
      "title": "Agent Tool Binding & Dispatch: Harden",
      "description": "[Agent Tool Binding & Dispatch] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..",
      "trigger": "Audit and harden \"Agent Tool Binding & Dispatch\". The common failure pattern \"Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.\" may be present. Follow the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Agent Tool Binding & Dispatch. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Apply the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:agent-tool-binding",
          "workflow:harden",
          "security",
          "agents",
          "tool-binding",
          "orchestration"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "analytics_metric_definition_harden",
      "title": "Analytics Metric Definitions: Harden",
      "description": "[Analytics Metric Definitions] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..",
      "trigger": "Audit and harden \"Analytics Metric Definitions\". The common failure pattern \"Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.\" may be present. Follow the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Analytics Metric Definitions. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Apply the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:analytics-metric-definition",
          "workflow:harden",
          "security",
          "analytics",
          "metrics",
          "data"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "adr_documentation_harden",
      "title": "Architecture Decision Records: Harden",
      "description": "[Architecture Decision Records] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..",
      "trigger": "Audit and harden \"Architecture Decision Records\". The common failure pattern \"Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.\" may be present. Follow the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific ADR document / decision log / template / review workflow this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Architecture Decision Records. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Apply the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:adr-documentation",
          "workflow:harden",
          "security",
          "documentation",
          "adr",
          "architecture"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "aws_lambda_cold_start_harden",
      "title": "AWS Lambda Cold Starts: Harden",
      "description": "[AWS Lambda Cold Starts] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..",
      "trigger": "Audit and harden \"AWS Lambda Cold Starts\". The common failure pattern \"Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.\" may be present. Follow the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening AWS Lambda Cold Starts. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Apply the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:aws-lambda-cold-start",
          "workflow:harden",
          "security",
          "aws",
          "lambda",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "azure_bicep_harden",
      "title": "Azure Bicep Infrastructure: Harden",
      "description": "[Azure Bicep Infrastructure] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..",
      "trigger": "Audit and harden \"Azure Bicep Infrastructure\". The common failure pattern \"Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.\" may be present. Follow the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific main.bicep / module / parameter file / azd template this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Azure Bicep Infrastructure. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Apply the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:azure-bicep",
          "workflow:harden",
          "security",
          "azure",
          "bicep",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "browser_devtools_harden",
      "title": "Browser DevTools & Debugging: Harden",
      "description": "[Browser DevTools & Debugging] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..",
      "trigger": "Audit and harden \"Browser DevTools & Debugging\". The common failure pattern \"Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.\" may be present. Follow the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Browser DevTools & Debugging. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Apply the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:browser-devtools",
          "workflow:harden",
          "security",
          "browser",
          "debugging",
          "devtools"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cli_tool_design_harden",
      "title": "CLI Tool Design Patterns: Harden",
      "description": "[CLI Tool Design Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..",
      "trigger": "Audit and harden \"CLI Tool Design Patterns\". The common failure pattern \"Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.\" may be present. Follow the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening CLI Tool Design Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Apply the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:cli-tool-design",
          "workflow:harden",
          "security",
          "cli",
          "devtools",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cloud_cost_optimization_harden",
      "title": "Cloud Cost Optimisation: Harden",
      "description": "[Cloud Cost Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..",
      "trigger": "Audit and harden \"Cloud Cost Optimisation\". The common failure pattern \"Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.\" may be present. Follow the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Cloud Cost Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Apply the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:cloud-cost-optimization",
          "workflow:harden",
          "security",
          "cloud",
          "cost",
          "optimization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "code_review_checklist_harden",
      "title": "Code Review Checklist: Harden",
      "description": "[Code Review Checklist] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..",
      "trigger": "Audit and harden \"Code Review Checklist\". The common failure pattern \"Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.\" may be present. Follow the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific review checklist / automated review comment / risk classification / diff summary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Code Review Checklist. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Apply the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:code-review-checklist",
          "workflow:harden",
          "security",
          "code-review",
          "quality",
          "checklist"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "convex_functions_harden",
      "title": "Convex Functions & Mutations: Harden",
      "description": "[Convex Functions & Mutations] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..",
      "trigger": "Audit and harden \"Convex Functions & Mutations\". The common failure pattern \"Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.\" may be present. Follow the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific mutation / query / action / component / scheduler job this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Convex Functions & Mutations. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Apply the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:convex-functions",
          "workflow:harden",
          "security",
          "convex",
          "realtime",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "cron_job_reliability_harden",
      "title": "Cron Job & Scheduled Task Reliability: Harden",
      "description": "[Cron Job & Scheduled Task Reliability] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..",
      "trigger": "Audit and harden \"Cron Job & Scheduled Task Reliability\". The common failure pattern \"Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.\" may be present. Follow the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Cron Job & Scheduled Task Reliability. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Apply the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:cron-job-reliability",
          "workflow:harden",
          "security",
          "cron",
          "scheduling",
          "reliability"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "css_layout_harden",
      "title": "CSS Layout & Responsiveness: Harden",
      "description": "[CSS Layout & Responsiveness] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..",
      "trigger": "Audit and harden \"CSS Layout & Responsiveness\". The common failure pattern \"Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.\" may be present. Follow the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSS layout refactor / responsive grid / container query implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening CSS Layout & Responsiveness. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Apply the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:css-layout",
          "workflow:harden",
          "security",
          "css",
          "layout",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "csv_data_cleaning_harden",
      "title": "CSV Data Cleaning Pipeline: Harden",
      "description": "[CSV Data Cleaning Pipeline] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..",
      "trigger": "Audit and harden \"CSV Data Cleaning Pipeline\". The common failure pattern \"Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.\" may be present. Follow the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening CSV Data Cleaning Pipeline. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Apply the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:csv-data-cleaning",
          "workflow:harden",
          "security",
          "data",
          "csv",
          "pipeline"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "database_migration_safety_harden",
      "title": "Database Migration Safety: Harden",
      "description": "[Database Migration Safety] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..",
      "trigger": "Audit and harden \"Database Migration Safety\". The common failure pattern \"Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.\" may be present. Follow the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Database Migration Safety. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Apply the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:database-migration-safety",
          "workflow:harden",
          "security",
          "database",
          "migration",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "data_warehouse_schema_harden",
      "title": "Data Warehouse Schema Design: Harden",
      "description": "[Data Warehouse Schema Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..",
      "trigger": "Audit and harden \"Data Warehouse Schema Design\". The common failure pattern \"Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.\" may be present. Follow the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific star schema / fact table / dimension table / ETL pipeline spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Data Warehouse Schema Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Apply the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:data-warehouse-schema",
          "workflow:harden",
          "security",
          "data",
          "warehouse",
          "schema"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "design_token_system_harden",
      "title": "Design Token Systems: Harden",
      "description": "[Design Token Systems] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..",
      "trigger": "Audit and harden \"Design Token Systems\". The common failure pattern \"Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.\" may be present. Follow the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Design Token Systems. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Apply the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:design-token-system",
          "workflow:harden",
          "security",
          "design",
          "tokens",
          "components"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_compose_networking_harden",
      "title": "Docker Compose Networking: Harden",
      "description": "[Docker Compose Networking] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..",
      "trigger": "Audit and harden \"Docker Compose Networking\". The common failure pattern \"Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.\" may be present. Follow the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Docker Compose Networking. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Apply the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:docker-compose-networking",
          "workflow:harden",
          "security",
          "docker",
          "networking",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "docker_multistage_harden",
      "title": "Docker Multi-Stage Builds: Harden",
      "description": "[Docker Multi-Stage Builds] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..",
      "trigger": "Audit and harden \"Docker Multi-Stage Builds\". The common failure pattern \"Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.\" may be present. Follow the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Docker Multi-Stage Builds. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Apply the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:docker-multistage",
          "workflow:harden",
          "security",
          "docker",
          "build",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "drizzle_schema_design_harden",
      "title": "Drizzle Schema Design: Harden",
      "description": "[Drizzle Schema Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..",
      "trigger": "Audit and harden \"Drizzle Schema Design\". The common failure pattern \"Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.\" may be present. Follow the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Drizzle Schema Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Apply the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:drizzle-schema-design",
          "workflow:harden",
          "security",
          "drizzle",
          "schema",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "error_monitoring_setup_harden",
      "title": "Error Monitoring & Alerting Setup: Harden",
      "description": "[Error Monitoring & Alerting Setup] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..",
      "trigger": "Audit and harden \"Error Monitoring & Alerting Setup\". The common failure pattern \"Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.\" may be present. Follow the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Error Monitoring & Alerting Setup. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Apply the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:error-monitoring-setup",
          "workflow:harden",
          "security",
          "monitoring",
          "errors",
          "alerts"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "fastapi_dependencies_harden",
      "title": "FastAPI Dependency Injection: Harden",
      "description": "[FastAPI Dependency Injection] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..",
      "trigger": "Audit and harden \"FastAPI Dependency Injection\". The common failure pattern \"Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.\" may be present. Follow the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific dependency / lifespan handler / override for testing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening FastAPI Dependency Injection. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Apply the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:fastapi-dependencies",
          "workflow:harden",
          "security",
          "fastapi",
          "dependencies",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "feature_flags_harden",
      "title": "Feature Flags & Gradual Rollouts: Harden",
      "description": "[Feature Flags & Gradual Rollouts] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..",
      "trigger": "Audit and harden \"Feature Flags & Gradual Rollouts\". The common failure pattern \"Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.\" may be present. Follow the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Feature Flags & Gradual Rollouts. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Apply the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:feature-flags",
          "workflow:harden",
          "security",
          "feature-flags",
          "rollout",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "git_conflict_resolution_harden",
      "title": "Git Conflict Resolution: Harden",
      "description": "[Git Conflict Resolution] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..",
      "trigger": "Audit and harden \"Git Conflict Resolution\". The common failure pattern \"Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.\" may be present. Follow the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Git Conflict Resolution. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Apply the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:git-conflict-resolution",
          "workflow:harden",
          "security",
          "git",
          "conflicts",
          "workflow"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "github_actions_pipeline_harden",
      "title": "GitHub Actions Pipeline Optimisation: Harden",
      "description": "[GitHub Actions Pipeline Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..",
      "trigger": "Audit and harden \"GitHub Actions Pipeline Optimisation\". The common failure pattern \"Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.\" may be present. Follow the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific workflow YAML / cache config / matrix build / conditional job execution this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening GitHub Actions Pipeline Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Apply the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:github-actions-pipeline",
          "workflow:harden",
          "security",
          "github-actions",
          "ci",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "graphql_n_plus_one_harden",
      "title": "GraphQL N+1 Query Prevention: Harden",
      "description": "[GraphQL N+1 Query Prevention] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..",
      "trigger": "Audit and harden \"GraphQL N+1 Query Prevention\". The common failure pattern \"A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.\" may be present. Follow the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening GraphQL N+1 Query Prevention. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Apply the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:graphql-n-plus-one",
          "workflow:harden",
          "security",
          "graphql",
          "n-plus-one",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "jest_test_optimization_harden",
      "title": "Jest Test Optimisation: Harden",
      "description": "[Jest Test Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..",
      "trigger": "Audit and harden \"Jest Test Optimisation\". The common failure pattern \"Running the entire test suite on every change, taking minutes even for small incremental code changes.\" may be present. Follow the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Jest Test Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Apply the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:jest-test-optimization",
          "workflow:harden",
          "security",
          "jest",
          "testing",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "json_schema_validation_harden",
      "title": "JSON Schema Validation: Harden",
      "description": "[JSON Schema Validation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..",
      "trigger": "Audit and harden \"JSON Schema Validation\". The common failure pattern \"Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.\" may be present. Follow the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening JSON Schema Validation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Apply the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:json-schema-validation",
          "workflow:harden",
          "security",
          "json",
          "validation",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_hpa_harden",
      "title": "Kubernetes Horizontal Pod Autoscaling: Harden",
      "description": "[Kubernetes Horizontal Pod Autoscaling] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..",
      "trigger": "Audit and harden \"Kubernetes Horizontal Pod Autoscaling\". The common failure pattern \"HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.\" may be present. Follow the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Kubernetes Horizontal Pod Autoscaling. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Apply the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:kubernetes-hpa",
          "workflow:harden",
          "security",
          "kubernetes",
          "autoscaling",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "kubernetes_pod_lifecycle_harden",
      "title": "Kubernetes Pod Lifecycle: Harden",
      "description": "[Kubernetes Pod Lifecycle] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..",
      "trigger": "Audit and harden \"Kubernetes Pod Lifecycle\". The common failure pattern \"Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.\" may be present. Follow the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Kubernetes Pod Lifecycle. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Apply the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:kubernetes-pod-lifecycle",
          "workflow:harden",
          "security",
          "kubernetes",
          "pods",
          "devops"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "context_window_budget_harden",
      "title": "LLM Context Window Budget Management: Harden",
      "description": "[LLM Context Window Budget Management] Audit for the failure pattern, apply the best practice, rank findings by severity Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..",
      "trigger": "Audit and harden \"LLM Context Window Budget Management\". The common failure pattern \"Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.\" may be present. Follow the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "markdown",
          "name": "md",
          "description": "MD output"
        },
        {
          "kind": "checklist",
          "name": "chk",
          "description": "CHK output"
        }
      ],
      "promptTemplate": "You are hardening LLM Context Window Budget Management. Audit for the failure pattern, apply the best practice, rank findings by severity. Check for: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Apply the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:context-window-budget",
          "workflow:harden",
          "security",
          "context",
          "tokens",
          "llm",
          "memory",
          "summarization"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "mcp_tool_design_harden",
      "title": "MCP Tool Design & Best Practices: Harden",
      "description": "[MCP Tool Design & Best Practices] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..",
      "trigger": "Audit and harden \"MCP Tool Design & Best Practices\". The common failure pattern \"Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.\" may be present. Follow the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening MCP Tool Design & Best Practices. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Apply the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:mcp-tool-design",
          "workflow:harden",
          "security",
          "mcp",
          "tools",
          "agents"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "message_queues_harden",
      "title": "Message Queues & Background Jobs: Harden",
      "description": "[Message Queues & Background Jobs] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..",
      "trigger": "Audit and harden \"Message Queues & Background Jobs\". The common failure pattern \"Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.\" may be present. Follow the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific queue producer / worker / dead-letter handler / retry policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Message Queues & Background Jobs. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Apply the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:message-queues",
          "workflow:harden",
          "security",
          "queue",
          "background-jobs",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "multi_tenant_isolation_harden",
      "title": "Multi-Tenant Data Isolation: Harden",
      "description": "[Multi-Tenant Data Isolation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..",
      "trigger": "Audit and harden \"Multi-Tenant Data Isolation\". The common failure pattern \"Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.\" may be present. Follow the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Multi-Tenant Data Isolation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Apply the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:multi-tenant-isolation",
          "workflow:harden",
          "security",
          "multi-tenant",
          "saas",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_api_routes_harden",
      "title": "Next.js API Routes & Route Handlers: Harden",
      "description": "[Next.js API Routes & Route Handlers] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..",
      "trigger": "Audit and harden \"Next.js API Routes & Route Handlers\". The common failure pattern \"Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.\" may be present. Follow the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific route.ts handler / server action / API client wrapper / error boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Next.js API Routes & Route Handlers. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Apply the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:nextjs-api-routes",
          "workflow:harden",
          "security",
          "nextjs",
          "api",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_data_fetching_harden",
      "title": "Next.js Data Fetching Patterns: Harden",
      "description": "[Next.js Data Fetching Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..",
      "trigger": "Audit and harden \"Next.js Data Fetching Patterns\". The common failure pattern \"Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.\" may be present. Follow the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server fetch / React cache wrapper / streaming suspense boundary this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Next.js Data Fetching Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Apply the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:nextjs-data-fetching",
          "workflow:harden",
          "security",
          "nextjs",
          "data-fetching",
          "fullstack"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "nextjs_middleware_harden",
      "title": "Next.js Middleware & Edge Runtime: Harden",
      "description": "[Next.js Middleware & Edge Runtime] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..",
      "trigger": "Audit and harden \"Next.js Middleware & Edge Runtime\". The common failure pattern \"Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.\" may be present. Follow the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Next.js Middleware & Edge Runtime. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Apply the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:nextjs-middleware",
          "workflow:harden",
          "security",
          "nextjs",
          "middleware",
          "edge"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_error_handling_harden",
      "title": "Node.js Error Handling & Resilience: Harden",
      "description": "[Node.js Error Handling & Resilience] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..",
      "trigger": "Audit and harden \"Node.js Error Handling & Resilience\". The common failure pattern \"Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.\" may be present. Follow the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific global error handler / async wrapper / structured error response / retry logic this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Node.js Error Handling & Resilience. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Apply the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:node-error-handling",
          "workflow:harden",
          "security",
          "node",
          "error-handling",
          "backend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "node_streams_harden",
      "title": "Node.js Streams & Backpressure: Harden",
      "description": "[Node.js Streams & Backpressure] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..",
      "trigger": "Audit and harden \"Node.js Streams & Backpressure\". The common failure pattern \"Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.\" may be present. Follow the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Readable/Writable stream / Transform / pipeline() refactor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Node.js Streams & Backpressure. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Apply the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:node-streams",
          "workflow:harden",
          "security",
          "node",
          "streams",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "oauth_flows_harden",
      "title": "OAuth 2.0 Flows & Token Management: Harden",
      "description": "[OAuth 2.0 Flows & Token Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..",
      "trigger": "Audit and harden \"OAuth 2.0 Flows & Token Management\". The common failure pattern \"Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.\" may be present. Follow the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening OAuth 2.0 Flows & Token Management. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Apply the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:oauth-flows",
          "workflow:harden",
          "security",
          "oauth",
          "auth"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "openapi_spec_harden",
      "title": "OpenAPI Specification & Validation: Harden",
      "description": "[OpenAPI Specification & Validation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..",
      "trigger": "Audit and harden \"OpenAPI Specification & Validation\". The common failure pattern \"Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.\" may be present. Follow the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific openapi.yaml / code-first generator / request/response validation middleware this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening OpenAPI Specification & Validation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Apply the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:openapi-spec",
          "workflow:harden",
          "security",
          "openapi",
          "api",
          "contract"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "playwright_selectors_harden",
      "title": "Playwright Selectors & Locators: Harden",
      "description": "[Playwright Selectors & Locators] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..",
      "trigger": "Audit and harden \"Playwright Selectors & Locators\". The common failure pattern \"Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.\" may be present. Follow the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Playwright Selectors & Locators. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Apply the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:playwright-selectors",
          "workflow:harden",
          "security",
          "playwright",
          "testing",
          "e2e"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "prompt_injection_defense_harden",
      "title": "Prompt Injection Defense: Harden",
      "description": "[Prompt Injection Defense] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..",
      "trigger": "Audit and harden \"Prompt Injection Defense\". The common failure pattern \"Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.\" may be present. Follow the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Prompt Injection Defense. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Apply the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:prompt-injection-defense",
          "workflow:harden",
          "security",
          "prompt",
          "llm"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_async_harden",
      "title": "Python Async/Await Patterns: Harden",
      "description": "[Python Async/Await Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..",
      "trigger": "Audit and harden \"Python Async/Await Patterns\". The common failure pattern \"Blocking the event loop by using synchronous requests or time.sleep inside async functions.\" may be present. Follow the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific async/await refactor / asyncio.gather / async context manager this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Python Async/Await Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Apply the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:python-async",
          "workflow:harden",
          "security",
          "python",
          "async",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "python_file_io_harden",
      "title": "Python File I/O & Encoding: Harden",
      "description": "[Python File I/O & Encoding] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..",
      "trigger": "Audit and harden \"Python File I/O & Encoding\". The common failure pattern \"Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.\" may be present. Follow the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Python File I/O & Encoding. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Apply the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:python-file-io",
          "workflow:harden",
          "security",
          "python",
          "file-io",
          "scripting"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rag_chunking_harden",
      "title": "RAG Chunking Strategies: Harden",
      "description": "[RAG Chunking Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..",
      "trigger": "Audit and harden \"RAG Chunking Strategies\". The common failure pattern \"Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.\" may be present. Follow the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening RAG Chunking Strategies. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Apply the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:rag-chunking",
          "workflow:harden",
          "security",
          "rag",
          "chunking",
          "retrieval"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rate_limiting_proxy_harden",
      "title": "Rate Limiting & API Gateway Proxy: Harden",
      "description": "[Rate Limiting & API Gateway Proxy] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..",
      "trigger": "Audit and harden \"Rate Limiting & API Gateway Proxy\". The common failure pattern \"Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.\" may be present. Follow the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Rate Limiting & API Gateway Proxy. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Apply the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:rate-limiting-proxy",
          "workflow:harden",
          "security",
          "rate-limiting",
          "proxy"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_server_components_harden",
      "title": "React Server Components: Harden",
      "description": "[React Server Components] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..",
      "trigger": "Audit and harden \"React Server Components\". The common failure pattern \"Accidentally making a server component a client component by using hooks or event handlers in the wrong file.\" may be present. Follow the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific server component / client boundary refactor / streaming fallback this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening React Server Components. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Apply the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:react-server-components",
          "workflow:harden",
          "security",
          "react",
          "rsc",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "react_state_harden",
      "title": "React State Management: Harden",
      "description": "[React State Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..",
      "trigger": "Audit and harden \"React State Management\". The common failure pattern \"Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.\" may be present. Follow the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening React State Management. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Apply the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:react-state",
          "workflow:harden",
          "security",
          "react",
          "state",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "redis_caching_harden",
      "title": "Redis Caching Strategies: Harden",
      "description": "[Redis Caching Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..",
      "trigger": "Audit and harden \"Redis Caching Strategies\". The common failure pattern \"Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.\" may be present. Follow the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Redis Caching Strategies. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Apply the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:redis-caching",
          "workflow:harden",
          "security",
          "redis",
          "caching",
          "performance"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "rest_pagination_harden",
      "title": "REST Pagination Design: Harden",
      "description": "[REST Pagination Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..",
      "trigger": "Audit and harden \"REST Pagination Design\". The common failure pattern \"Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.\" may be present. Follow the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening REST Pagination Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Apply the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:rest-pagination",
          "workflow:harden",
          "security",
          "rest",
          "pagination",
          "api"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "secrets_rotation_harden",
      "title": "Secrets Rotation Policy: Harden",
      "description": "[Secrets Rotation Policy] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..",
      "trigger": "Audit and harden \"Secrets Rotation Policy\". The common failure pattern \"Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.\" may be present. Follow the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific rotation script / vault integration / lease management / incident response plan this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Secrets Rotation Policy. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Apply the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:secrets-rotation",
          "workflow:harden",
          "security",
          "secrets",
          "rotation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "shell_script_robustness_harden",
      "title": "Shell Script Robustness & Safety: Harden",
      "description": "[Shell Script Robustness & Safety] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..",
      "trigger": "Audit and harden \"Shell Script Robustness & Safety\". The common failure pattern \"Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.\" may be present. Follow the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Shell Script Robustness & Safety. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Apply the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:shell-script-robustness",
          "workflow:harden",
          "security",
          "shell",
          "scripting",
          "safety"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "sql_query_optimization_harden",
      "title": "SQL Query Optimisation: Harden",
      "description": "[SQL Query Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..",
      "trigger": "Audit and harden \"SQL Query Optimisation\". The common failure pattern \"Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.\" may be present. Follow the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening SQL Query Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Apply the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:sql-query-optimization",
          "workflow:harden",
          "security",
          "sql",
          "optimization",
          "database"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stealth_web_research_harden",
      "title": "Stealth Web Research & Harvesting: Harden",
      "description": "[Stealth Web Research & Harvesting] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..",
      "trigger": "Audit and harden \"Stealth Web Research & Harvesting\". The common failure pattern \"Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.\" may be present. Follow the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Stealth Web Research & Harvesting. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Apply the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:stealth-web-research",
          "workflow:harden",
          "security",
          "stealth",
          "scraping",
          "research",
          "anti-bot"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "stripe_webhook_idempotency_harden",
      "title": "Stripe Webhook Idempotency: Harden",
      "description": "[Stripe Webhook Idempotency] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..",
      "trigger": "Audit and harden \"Stripe Webhook Idempotency\". The common failure pattern \"Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.\" may be present. Follow the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Stripe Webhook Idempotency. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Apply the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:stripe-webhook-idempotency",
          "workflow:harden",
          "security",
          "stripe",
          "webhook",
          "payments"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "supabase_rls_harden",
      "title": "Supabase Row-Level Security: Harden",
      "description": "[Supabase Row-Level Security] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..",
      "trigger": "Audit and harden \"Supabase Row-Level Security\". The common failure pattern \"RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.\" may be present. Follow the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific RLS policy / policy test / security definer function / admin bypass this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Supabase Row-Level Security. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Apply the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:supabase-rls",
          "workflow:harden",
          "security",
          "supabase",
          "rls"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "terraform_state_harden",
      "title": "Terraform State Management: Harden",
      "description": "[Terraform State Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..",
      "trigger": "Audit and harden \"Terraform State Management\". The common failure pattern \"Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.\" may be present. Follow the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific backend config / state migration plan / state locking config / remote state datasource this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Terraform State Management. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Apply the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:terraform-state",
          "workflow:harden",
          "security",
          "terraform",
          "state",
          "iac"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "typescript_generics_harden",
      "title": "TypeScript Generics & Advanced Types: Harden",
      "description": "[TypeScript Generics & Advanced Types] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..",
      "trigger": "Audit and harden \"TypeScript Generics & Advanced Types\". The common failure pattern \"Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).\" may be present. Follow the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific generic type / conditional type / mapped type / branded type this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening TypeScript Generics & Advanced Types. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Apply the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:typescript-generics",
          "workflow:harden",
          "security",
          "typescript",
          "generics",
          "type-system"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "user_onboarding_flow_harden",
      "title": "User Onboarding Flow Design: Harden",
      "description": "[User Onboarding Flow Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..",
      "trigger": "Audit and harden \"User Onboarding Flow Design\". The common failure pattern \"Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.\" may be present. Follow the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening User Onboarding Flow Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Apply the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:user-onboarding-flow",
          "workflow:harden",
          "security",
          "ux",
          "onboarding",
          "product"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "vercel_env_vars_harden",
      "title": "Vercel Environment Variables: Harden",
      "description": "[Vercel Environment Variables] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..",
      "trigger": "Audit and harden \"Vercel Environment Variables\". The common failure pattern \"Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.\" may be present. Follow the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific vercel.json env group / preview env config / Edge Config / KV store this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Vercel Environment Variables. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Apply the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:vercel-env-vars",
          "workflow:harden",
          "security",
          "vercel",
          "env",
          "deployment"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_scraping_ethics_harden",
      "title": "Web Scraping Ethics & Compliance: Harden",
      "description": "[Web Scraping Ethics & Compliance] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..",
      "trigger": "Audit and harden \"Web Scraping Ethics & Compliance\". The common failure pattern \"Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.\" may be present. Follow the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Web Scraping Ethics & Compliance. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Apply the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:web-scraping-ethics",
          "workflow:harden",
          "security",
          "scraping",
          "ethics",
          "research"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "websocket_reconnection_harden",
      "title": "WebSocket Reconnection Strategies: Harden",
      "description": "[WebSocket Reconnection Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..",
      "trigger": "Audit and harden \"WebSocket Reconnection Strategies\". The common failure pattern \"Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.\" may be present. Follow the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening WebSocket Reconnection Strategies. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Apply the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:websocket-reconnection",
          "workflow:harden",
          "security",
          "websocket",
          "realtime",
          "frontend"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    },
    {
      "name": "web_vitals_optimization_harden",
      "title": "Web Vitals Optimisation (LCP/CLS/INP): Harden",
      "description": "[Web Vitals Optimisation (LCP/CLS/INP)] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..",
      "trigger": "Audit and harden \"Web Vitals Optimisation (LCP/CLS/INP)\". The common failure pattern \"Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).\" may be present. Follow the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Produce a risk-ranked list of findings.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "goal": {
            "type": "string",
            "description": "The precise outcome the user wants to achieve."
          },
          "context": {
            "type": "string",
            "description": "Project, file, conversation or task context."
          },
          "assets": {
            "type": "string",
            "description": "Relevant code, logs, URLs, documents or data samples."
          },
          "domainArtifact": {
            "type": "string",
            "description": "The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves."
          }
        },
        "required": [
          "goal"
        ]
      },
      "outputContract": [
        {
          "kind": "json",
          "name": "manifest",
          "description": "Machine-readable plan, contract or registry output."
        },
        {
          "kind": "checklist",
          "name": "checklist",
          "description": "Executable steps with risk assessment and validation items."
        }
      ],
      "promptTemplate": "You are hardening Web Vitals Optimisation (LCP/CLS/INP). Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Apply the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Rank findings by severity.",
      "metadata": {
        "risk": "high",
        "tags": [
          "target:web-vitals-optimization",
          "workflow:harden",
          "security",
          "performance",
          "web-vitals",
          "optimisation"
        ],
        "agentAgnostic": true,
        "modelAgnostic": true
      }
    }
  ]
}
__USB_ADAPTER_JSON_297FC90916FD0233__

write_file "$PACK_DIR/cursor-rule.mdc" <<'__USB_CURSOR_RULE_90E7CDAC35836F28__'
---
description: Universal Skill Bridge Catalog router rules
globs: ["**/*"]
alwaysApply: false
---

# Universal Skill Bridge Catalog

This rule file introduces the modular skill pack to the IDE agent as a compact router.

## Router rule
Classify the user's request first by intent, risk, context, and required output type. Pick the best-fitting skill slug below, write a brief rationale, and apply that skill's protocol.

- a-b-testing-framework-audit: You need to examine the current "A/B Testing Framework" setup without making changes. Look for the specific failure pattern: "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- a11y-aria-patterns-audit: You need to examine the current "Accessibility ARIA Patterns" setup without making changes. Look for the specific failure pattern: "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- agent-tool-binding-audit: You need to examine the current "Agent Tool Binding & Dispatch" setup without making changes. Look for the specific failure pattern: "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- analytics-metric-definition-audit: You need to examine the current "Analytics Metric Definitions" setup without making changes. Look for the specific failure pattern: "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- adr-documentation-audit: You need to examine the current "Architecture Decision Records" setup without making changes. Look for the specific failure pattern: "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- aws-lambda-cold-start-audit: You need to examine the current "AWS Lambda Cold Starts" setup without making changes. Look for the specific failure pattern: "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- azure-bicep-audit: You need to examine the current "Azure Bicep Infrastructure" setup without making changes. Look for the specific failure pattern: "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- browser-devtools-audit: You need to examine the current "Browser DevTools & Debugging" setup without making changes. Look for the specific failure pattern: "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- cli-tool-design-audit: You need to examine the current "CLI Tool Design Patterns" setup without making changes. Look for the specific failure pattern: "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- cloud-cost-optimization-audit: You need to examine the current "Cloud Cost Optimisation" setup without making changes. Look for the specific failure pattern: "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- code-review-checklist-audit: You need to examine the current "Code Review Checklist" setup without making changes. Look for the specific failure pattern: "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- convex-functions-audit: You need to examine the current "Convex Functions & Mutations" setup without making changes. Look for the specific failure pattern: "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- cron-job-reliability-audit: You need to examine the current "Cron Job & Scheduled Task Reliability" setup without making changes. Look for the specific failure pattern: "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- css-layout-audit: You need to examine the current "CSS Layout & Responsiveness" setup without making changes. Look for the specific failure pattern: "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- csv-data-cleaning-audit: You need to examine the current "CSV Data Cleaning Pipeline" setup without making changes. Look for the specific failure pattern: "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- database-migration-safety-audit: You need to examine the current "Database Migration Safety" setup without making changes. Look for the specific failure pattern: "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- data-warehouse-schema-audit: You need to examine the current "Data Warehouse Schema Design" setup without making changes. Look for the specific failure pattern: "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- design-token-system-audit: You need to examine the current "Design Token Systems" setup without making changes. Look for the specific failure pattern: "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- docker-compose-networking-audit: You need to examine the current "Docker Compose Networking" setup without making changes. Look for the specific failure pattern: "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- docker-multistage-audit: You need to examine the current "Docker Multi-Stage Builds" setup without making changes. Look for the specific failure pattern: "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- drizzle-schema-design-audit: You need to examine the current "Drizzle Schema Design" setup without making changes. Look for the specific failure pattern: "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- error-monitoring-setup-audit: You need to examine the current "Error Monitoring & Alerting Setup" setup without making changes. Look for the specific failure pattern: "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- fastapi-dependencies-audit: You need to examine the current "FastAPI Dependency Injection" setup without making changes. Look for the specific failure pattern: "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- feature-flags-audit: You need to examine the current "Feature Flags & Gradual Rollouts" setup without making changes. Look for the specific failure pattern: "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- git-conflict-resolution-audit: You need to examine the current "Git Conflict Resolution" setup without making changes. Look for the specific failure pattern: "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- github-actions-pipeline-audit: You need to examine the current "GitHub Actions Pipeline Optimisation" setup without making changes. Look for the specific failure pattern: "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- graphql-n-plus-one-audit: You need to examine the current "GraphQL N+1 Query Prevention" setup without making changes. Look for the specific failure pattern: "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- jest-test-optimization-audit: You need to examine the current "Jest Test Optimisation" setup without making changes. Look for the specific failure pattern: "Running the entire test suite on every change, taking minutes even for small incremental code changes.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- json-schema-validation-audit: You need to examine the current "JSON Schema Validation" setup without making changes. Look for the specific failure pattern: "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- kubernetes-hpa-audit: You need to examine the current "Kubernetes Horizontal Pod Autoscaling" setup without making changes. Look for the specific failure pattern: "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- kubernetes-pod-lifecycle-audit: You need to examine the current "Kubernetes Pod Lifecycle" setup without making changes. Look for the specific failure pattern: "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- context-window-budget-audit: You need to examine the current "LLM Context Window Budget Management" setup without making changes. Look for the specific failure pattern: "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- mcp-tool-design-audit: You need to examine the current "MCP Tool Design & Best Practices" setup without making changes. Look for the specific failure pattern: "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- message-queues-audit: You need to examine the current "Message Queues & Background Jobs" setup without making changes. Look for the specific failure pattern: "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- multi-tenant-isolation-audit: You need to examine the current "Multi-Tenant Data Isolation" setup without making changes. Look for the specific failure pattern: "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- nextjs-api-routes-audit: You need to examine the current "Next.js API Routes & Route Handlers" setup without making changes. Look for the specific failure pattern: "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- nextjs-data-fetching-audit: You need to examine the current "Next.js Data Fetching Patterns" setup without making changes. Look for the specific failure pattern: "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- nextjs-middleware-audit: You need to examine the current "Next.js Middleware & Edge Runtime" setup without making changes. Look for the specific failure pattern: "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- node-error-handling-audit: You need to examine the current "Node.js Error Handling & Resilience" setup without making changes. Look for the specific failure pattern: "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- node-streams-audit: You need to examine the current "Node.js Streams & Backpressure" setup without making changes. Look for the specific failure pattern: "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- oauth-flows-audit: You need to examine the current "OAuth 2.0 Flows & Token Management" setup without making changes. Look for the specific failure pattern: "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- openapi-spec-audit: You need to examine the current "OpenAPI Specification & Validation" setup without making changes. Look for the specific failure pattern: "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- playwright-selectors-audit: You need to examine the current "Playwright Selectors & Locators" setup without making changes. Look for the specific failure pattern: "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- prompt-injection-defense-audit: You need to examine the current "Prompt Injection Defense" setup without making changes. Look for the specific failure pattern: "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- python-async-audit: You need to examine the current "Python Async/Await Patterns" setup without making changes. Look for the specific failure pattern: "Blocking the event loop by using synchronous requests or time.sleep inside async functions.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- python-file-io-audit: You need to examine the current "Python File I/O & Encoding" setup without making changes. Look for the specific failure pattern: "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- rag-chunking-audit: You need to examine the current "RAG Chunking Strategies" setup without making changes. Look for the specific failure pattern: "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- rate-limiting-proxy-audit: You need to examine the current "Rate Limiting & API Gateway Proxy" setup without making changes. Look for the specific failure pattern: "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- react-server-components-audit: You need to examine the current "React Server Components" setup without making changes. Look for the specific failure pattern: "Accidentally making a server component a client component by using hooks or event handlers in the wrong file.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- react-state-audit: You need to examine the current "React State Management" setup without making changes. Look for the specific failure pattern: "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- redis-caching-audit: You need to examine the current "Redis Caching Strategies" setup without making changes. Look for the specific failure pattern: "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- rest-pagination-audit: You need to examine the current "REST Pagination Design" setup without making changes. Look for the specific failure pattern: "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- secrets-rotation-audit: You need to examine the current "Secrets Rotation Policy" setup without making changes. Look for the specific failure pattern: "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- shell-script-robustness-audit: You need to examine the current "Shell Script Robustness & Safety" setup without making changes. Look for the specific failure pattern: "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- sql-query-optimization-audit: You need to examine the current "SQL Query Optimisation" setup without making changes. Look for the specific failure pattern: "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- stealth-web-research-audit: You need to examine the current "Stealth Web Research & Harvesting" setup without making changes. Look for the specific failure pattern: "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- stripe-webhook-idempotency-audit: You need to examine the current "Stripe Webhook Idempotency" setup without making changes. Look for the specific failure pattern: "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- supabase-rls-audit: You need to examine the current "Supabase Row-Level Security" setup without making changes. Look for the specific failure pattern: "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- terraform-state-audit: You need to examine the current "Terraform State Management" setup without making changes. Look for the specific failure pattern: "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- typescript-generics-audit: You need to examine the current "TypeScript Generics & Advanced Types" setup without making changes. Look for the specific failure pattern: "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- user-onboarding-flow-audit: You need to examine the current "User Onboarding Flow Design" setup without making changes. Look for the specific failure pattern: "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- vercel-env-vars-audit: You need to examine the current "Vercel Environment Variables" setup without making changes. Look for the specific failure pattern: "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- web-scraping-ethics-audit: You need to examine the current "Web Scraping Ethics & Compliance" setup without making changes. Look for the specific failure pattern: "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- websocket-reconnection-audit: You need to examine the current "WebSocket Reconnection Strategies" setup without making changes. Look for the specific failure pattern: "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- web-vitals-optimization-audit: You need to examine the current "Web Vitals Optimisation (LCP/CLS/INP)" setup without making changes. Look for the specific failure pattern: "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).". Call this when you want a structured inventory before deciding what to modify. Output: markdown, checklist.
- a-b-testing-framework-script: Create a reusable automation for "A/B Testing Framework". The task produces experiment spec / variant assignment / metric definition / statistical analysis script. Handle the failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.". Include a dry-run mode and test with statsmodels sample size calculation + Bayesian A/B test + sequential testing. Output: command, json, checklist.
- a11y-aria-patterns-script: Create a reusable automation for "Accessibility ARIA Patterns". The task produces ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Handle the failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.". Include a dry-run mode and test with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Output: command, json, checklist.
- agent-tool-binding-script: Create a reusable automation for "Agent Tool Binding & Dispatch". The task produces router tool / domain group / dynamic tool injection / tool usage statistics. Handle the failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.". Include a dry-run mode and test with agent trace log + tool invocation frequency analysis + token cost audit. Output: command, json, checklist.
- analytics-metric-definition-script: Create a reusable automation for "Analytics Metric Definitions". The task produces metric definition / dbt model / SQL logic / dashboard tile / documentation. Handle the failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.". Include a dry-run mode and test with dbt docs generate + dbt test --select tag:metrics + metric comparison script. Output: command, json, checklist.
- adr-documentation-script: Create a reusable automation for "Architecture Decision Records". The task produces ADR document / decision log / template / review workflow. Handle the failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.". Include a dry-run mode and test with adr-tools list + adr-tools generate + decision log index page. Output: command, json, checklist.
- aws-lambda-cold-start-script: Create a reusable automation for "AWS Lambda Cold Starts". The task produces handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Handle the failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.". Include a dry-run mode and test with AWS X-Ray trace + Lambda Insights + cold start dashboard. Output: command, json, checklist.
- azure-bicep-script: Create a reusable automation for "Azure Bicep Infrastructure". The task produces main.bicep / module / parameter file / azd template. Handle the failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.". Include a dry-run mode and test with az deployment group validate + az what-if + bicep build. Output: command, json, checklist.
- browser-devtools-script: Create a reusable automation for "Browser DevTools & Debugging". The task produces debugging workflow / breakpoint guide / performance recording / memory snapshot. Handle the failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.". Include a dry-run mode and test with Chrome DevTools performance recording + memory heap snapshot + network throttle. Output: command, json, checklist.
- cli-tool-design-script: Create a reusable automation for "CLI Tool Design Patterns". The task produces CLI scaffolding / argument parser / exit code handler / --json output mode. Handle the failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.". Include a dry-run mode and test with echo $? after CLI run + stderr redirection test + --json output validation. Output: command, json, checklist.
- cloud-cost-optimization-script: Create a reusable automation for "Cloud Cost Optimisation". The task produces right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Handle the failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.". Include a dry-run mode and test with cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Output: command, json, checklist.
- code-review-checklist-script: Create a reusable automation for "Code Review Checklist". The task produces review checklist / automated review comment / risk classification / diff summary. Handle the failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.". Include a dry-run mode and test with git diff --stat + lint-staged + danger.js automated review + commitlint. Output: command, json, checklist.
- convex-functions-script: Create a reusable automation for "Convex Functions & Mutations". The task produces mutation / query / action / component / scheduler job. Handle the failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.". Include a dry-run mode and test with npx convex dev + dashboard OCC conflict log + custom retry logic. Output: command, json, checklist.
- cron-job-reliability-script: Create a reusable automation for "Cron Job & Scheduled Task Reliability". The task produces crontab entry / log rotation / idempotency guard / failure alert integration. Handle the failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.". Include a dry-run mode and test with tail -f /var/log/cron + systemctl status cron + idempotency test script. Output: command, json, checklist.
- css-layout-script: Create a reusable automation for "CSS Layout & Responsiveness". The task produces CSS layout refactor / responsive grid / container query implementation. Handle the failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.". Include a dry-run mode and test with Lighthouse mobile emulation + browser DevTools responsive mode. Output: command, json, checklist.
- csv-data-cleaning-script: Create a reusable automation for "CSV Data Cleaning Pipeline". The task produces CSV parser / row validator / column type mapper / error report / cleaned output. Handle the failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.". Include a dry-run mode and test with python3 -c csv.DictReader + validation script + row count diff. Output: command, json, checklist.
- database-migration-safety-script: Create a reusable automation for "Database Migration Safety". The task produces batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Handle the failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.". Include a dry-run mode and test with pg_locks monitoring during migration + batch backfill script + rollback test. Output: command, json, checklist.
- data-warehouse-schema-script: Create a reusable automation for "Data Warehouse Schema Design". The task produces star schema / fact table / dimension table / ETL pipeline spec. Handle the failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.". Include a dry-run mode and test with dbt run + dbt test + query profiling with warehouse-native tools. Output: command, json, checklist.
- design-token-system-script: Create a reusable automation for "Design Token Systems". The task produces token JSON / CSS custom properties / theme switcher / token documentation. Handle the failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.". Include a dry-run mode and test with style-dictionary build + Storybook token viewer + token value comparison. Output: command, json, checklist.
- docker-compose-networking-script: Create a reusable automation for "Docker Compose Networking". The task produces docker-compose.yml / network config / healthcheck / depends_on condition. Handle the failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.". Include a dry-run mode and test with docker compose up --wait + docker network inspect + container logs. Output: command, json, checklist.
- docker-multistage-script: Create a reusable automation for "Docker Multi-Stage Builds". The task produces multi-stage Dockerfile / .dockerignore / slim base image switch. Handle the failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.". Include a dry-run mode and test with docker build + docker scout + dive layer analysis. Output: command, json, checklist.
- drizzle-schema-design-script: Create a reusable automation for "Drizzle Schema Design". The task produces schema.ts / relation map / migration SQL / Drizzle query builder. Handle the failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.". Include a dry-run mode and test with drizzle-kit push + drizzle-kit studio + generated SQL audit. Output: command, json, checklist.
- error-monitoring-setup-script: Create a reusable automation for "Error Monitoring & Alerting Setup". The task produces Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Handle the failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.". Include a dry-run mode and test with Sentry API error list + alert rule test + source map validation. Output: command, json, checklist.
- fastapi-dependencies-script: Create a reusable automation for "FastAPI Dependency Injection". The task produces dependency / lifespan handler / override for testing. Handle the failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.". Include a dry-run mode and test with uvicorn --reload + /docs interactive test + dependency graph visualisation. Output: command, json, checklist.
- feature-flags-script: Create a reusable automation for "Feature Flags & Gradual Rollouts". The task produces flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Handle the failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.". Include a dry-run mode and test with flag evaluation log + rollout percentage monitoring + unused flag scan. Output: command, json, checklist.
- git-conflict-resolution-script: Create a reusable automation for "Git Conflict Resolution". The task produces conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Handle the failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.". Include a dry-run mode and test with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Output: command, json, checklist.
- github-actions-pipeline-script: Create a reusable automation for "GitHub Actions Pipeline Optimisation". The task produces workflow YAML / cache config / matrix build / conditional job execution. Handle the failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.". Include a dry-run mode and test with act --job test + cache hit/miss analysis + workflow graph visualisation. Output: command, json, checklist.
- graphql-n-plus-one-script: Create a reusable automation for "GraphQL N+1 Query Prevention". The task produces DataLoader instance / batch load function / resolver refactor / query complexity analysis. Handle the failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.". Include a dry-run mode and test with graphql query with tracing + DataLoader statistics + SQL log analysis. Output: command, json, checklist.
- jest-test-optimization-script: Create a reusable automation for "Jest Test Optimisation". The task produces jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Handle the failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes.". Include a dry-run mode and test with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Output: command, json, checklist.
- json-schema-validation-script: Create a reusable automation for "JSON Schema Validation". The task produces JSON Schema / validator middleware / type guard / error message / response parser. Handle the failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.". Include a dry-run mode and test with ajv validate + JSON Schema test suite + response mock test. Output: command, json, checklist.
- kubernetes-hpa-script: Create a reusable automation for "Kubernetes Horizontal Pod Autoscaling". The task produces HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Handle the failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.". Include a dry-run mode and test with kubectl get hpa --watch + kubectl top pods + metrics-server logs. Output: command, json, checklist.
- kubernetes-pod-lifecycle-script: Create a reusable automation for "Kubernetes Pod Lifecycle". The task produces deployment.yaml / startup probe / readiness probe / liveness probe / init container. Handle the failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.". Include a dry-run mode and test with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Output: command, json, checklist.
- context-window-budget-script: Create a reusable automation for "LLM Context Window Budget Management". The task produces trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Handle the failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.". Include a dry-run mode and test with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Output: markdown, command.
- mcp-tool-design-script: Create a reusable automation for "MCP Tool Design & Best Practices". The task produces MCP tool descriptor / resource definition / prompt template / server metadata. Handle the failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.". Include a dry-run mode and test with mcp-cli run + mcp inspector + tool name conflict analysis. Output: command, json, checklist.
- message-queues-script: Create a reusable automation for "Message Queues & Background Jobs". The task produces queue producer / worker / dead-letter handler / retry policy. Handle the failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.". Include a dry-run mode and test with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Output: command, json, checklist.
- multi-tenant-isolation-script: Create a reusable automation for "Multi-Tenant Data Isolation". The task produces RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Handle the failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.". Include a dry-run mode and test with RLS policy test with two different tenant sessions + data leakage check. Output: command, json, checklist.
- nextjs-api-routes-script: Create a reusable automation for "Next.js API Routes & Route Handlers". The task produces route.ts handler / server action / API client wrapper / error boundary. Handle the failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.". Include a dry-run mode and test with curl --verbose + API route error log + status code audit. Output: command, json, checklist.
- nextjs-data-fetching-script: Create a reusable automation for "Next.js Data Fetching Patterns". The task produces server fetch / React cache wrapper / streaming suspense boundary. Handle the failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.". Include a dry-run mode and test with next build --debug + React DevTools fetch profiling. Output: command, json, checklist.
- nextjs-middleware-script: Create a reusable automation for "Next.js Middleware & Edge Runtime". The task produces middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Handle the failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.". Include a dry-run mode and test with next dev + curl --cookie tests + edge runtime log inspection. Output: command, json, checklist.
- node-error-handling-script: Create a reusable automation for "Node.js Error Handling & Resilience". The task produces global error handler / async wrapper / structured error response / retry logic. Handle the failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.". Include a dry-run mode and test with node --unhandled-rejections=strict + process.on('uncaughtException') log. Output: command, json, checklist.
- node-streams-script: Create a reusable automation for "Node.js Streams & Backpressure". The task produces Readable/Writable stream / Transform / pipeline() refactor. Handle the failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.". Include a dry-run mode and test with Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Output: command, json, checklist.
- oauth-flows-script: Create a reusable automation for "OAuth 2.0 Flows & Token Management". The task produces OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Handle the failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.". Include a dry-run mode and test with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Output: command, json, checklist.
- openapi-spec-script: Create a reusable automation for "OpenAPI Specification & Validation". The task produces openapi.yaml / code-first generator / request/response validation middleware. Handle the failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.". Include a dry-run mode and test with redocly lint + openapi-diff + swagger-ui preview. Output: command, json, checklist.
- playwright-selectors-script: Create a reusable automation for "Playwright Selectors & Locators". The task produces locator refactor / test fixture / POM (Page Object Model) / custom fixture. Handle the failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.". Include a dry-run mode and test with playwright test --reporter=html + playwright codegen + trace viewer. Output: command, json, checklist.
- prompt-injection-defense-script: Create a reusable automation for "Prompt Injection Defense". The task produces defensive system prompt / input sanitizer / instruction guardrail / output validator. Handle the failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.". Include a dry-run mode and test with prompt injection test suite + adversarial input fuzzing + output scanner. Output: command, json, checklist.
- python-async-script: Create a reusable automation for "Python Async/Await Patterns". The task produces async/await refactor / asyncio.gather / async context manager. Handle the failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions.". Include a dry-run mode and test with python3 -m asyncio + aiohttp/httpx async benchmark. Output: command, json, checklist.
- python-file-io-script: Create a reusable automation for "Python File I/O & Encoding". The task produces pathlib refactor / encoding-safe file reader / batch file processor. Handle the failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.". Include a dry-run mode and test with python3 -c with open() + chardet encoding detection. Output: command, json, checklist.
- rag-chunking-script: Create a reusable automation for "RAG Chunking Strategies". The task produces semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Handle the failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.". Include a dry-run mode and test with retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Output: command, json, checklist.
- rate-limiting-proxy-script: Create a reusable automation for "Rate Limiting & API Gateway Proxy". The task produces NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Handle the failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.". Include a dry-run mode and test with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Output: command, json, checklist.
- react-server-components-script: Create a reusable automation for "React Server Components". The task produces server component / client boundary refactor / streaming fallback. Handle the failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file.". Include a dry-run mode and test with next build --debug + React Server Components lint rule. Output: command, json, checklist.
- react-state-script: Create a reusable automation for "React State Management". The task produces useState / useReducer / useContext hook refactor, zustand or jotai store slice. Handle the failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.". Include a dry-run mode and test with React DevTools profiler + why-did-you-render. Output: command, json, checklist.
- redis-caching-script: Create a reusable automation for "Redis Caching Strategies". The task produces cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Handle the failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.". Include a dry-run mode and test with redis-cli --stat + cache hit ratio monitoring + slow log. Output: command, json, checklist.
- rest-pagination-script: Create a reusable automation for "REST Pagination Design". The task produces cursor pagination / offset pagination fallback / total count optimisation / response envelope. Handle the failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.". Include a dry-run mode and test with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Output: command, json, checklist.
- secrets-rotation-script: Create a reusable automation for "Secrets Rotation Policy". The task produces rotation script / vault integration / lease management / incident response plan. Handle the failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.". Include a dry-run mode and test with vault lease list + secret expiry check + rotation dry-run test. Output: command, json, checklist.
- shell-script-robustness-script: Create a reusable automation for "Shell Script Robustness & Safety". The task produces set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Handle the failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.". Include a dry-run mode and test with shellcheck script.sh + bash -n script.sh + dry-run mode test. Output: command, json, checklist.
- sql-query-optimization-script: Create a reusable automation for "SQL Query Optimisation". The task produces indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Handle the failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.". Include a dry-run mode and test with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Output: command, json, checklist.
- stealth-web-research-script: Create a reusable automation for "Stealth Web Research & Harvesting". The task produces clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Handle the failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.". Include a dry-run mode and test with playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Output: command, json, checklist.
- stripe-webhook-idempotency-script: Create a reusable automation for "Stripe Webhook Idempotency". The task produces Webhook handler / idempotency key check / event deduplication / failed payment recovery. Handle the failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.". Include a dry-run mode and test with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Output: command, json, checklist.
- supabase-rls-script: Create a reusable automation for "Supabase Row-Level Security". The task produces RLS policy / policy test / security definer function / admin bypass. Handle the failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.". Include a dry-run mode and test with supabase db check + supabase db test + RLS policy review with pg_policies. Output: command, json, checklist.
- terraform-state-script: Create a reusable automation for "Terraform State Management". The task produces backend config / state migration plan / state locking config / remote state datasource. Handle the failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.". Include a dry-run mode and test with terraform plan + terraform state list + terraform state pull | jq. Output: command, json, checklist.
- typescript-generics-script: Create a reusable automation for "TypeScript Generics & Advanced Types". The task produces generic type / conditional type / mapped type / branded type. Handle the failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).". Include a dry-run mode and test with tsc --noEmit --strict + type tests with expect-type. Output: command, json, checklist.
- user-onboarding-flow-script: Create a reusable automation for "User Onboarding Flow Design". The task produces onboarding wizard / feature checklist / in-app guide / first-run experience spec. Handle the failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.". Include a dry-run mode and test with analytics funnel analysis + onboarding completion rate + drop-off heatmap. Output: command, json, checklist.
- vercel-env-vars-script: Create a reusable automation for "Vercel Environment Variables". The task produces vercel.json env group / preview env config / Edge Config / KV store. Handle the failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.". Include a dry-run mode and test with vercel env pull + vercel list + project settings audit. Output: command, json, checklist.
- web-scraping-ethics-script: Create a reusable automation for "Web Scraping Ethics & Compliance". The task produces robots.txt check / polite scraper / rate-limited crawler / cached scraper. Handle the failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.". Include a dry-run mode and test with curl robots.txt + wget --wait + scraper log audit. Output: command, json, checklist.
- websocket-reconnection-script: Create a reusable automation for "WebSocket Reconnection Strategies". The task produces WebSocket client / reconnection logic / heartbeat / connection status component. Handle the failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.". Include a dry-run mode and test with Browser DevTools Network tab WS filter + reconnection test with server restart. Output: command, json, checklist.
- web-vitals-optimization-script: Create a reusable automation for "Web Vitals Optimisation (LCP/CLS/INP)". The task produces image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Handle the failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).". Include a dry-run mode and test with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Output: command, json, checklist.
- memory-compressor: Call this when a session is becoming too long for the context window, when handing off to another agent, or when the user asks for a session summary. Output: markdown.
- a-b-testing-framework-diagnose: Diagnose a problem in "A/B Testing Framework". The failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise." is a likely candidate. Isolate the root cause with minimal experiments. Use statsmodels sample size calculation + Bayesian A/B test + sequential testing for verification. Output: markdown, command, checklist.
- a11y-aria-patterns-diagnose: Diagnose a problem in "Accessibility ARIA Patterns". The failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers." is a likely candidate. Isolate the root cause with minimal experiments. Use axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit for verification. Output: markdown, command, checklist.
- agent-tool-binding-diagnose: Diagnose a problem in "Agent Tool Binding & Dispatch". The failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly." is a likely candidate. Isolate the root cause with minimal experiments. Use agent trace log + tool invocation frequency analysis + token cost audit for verification. Output: markdown, command, checklist.
- analytics-metric-definition-diagnose: Diagnose a problem in "Analytics Metric Definitions". The failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers." is a likely candidate. Isolate the root cause with minimal experiments. Use dbt docs generate + dbt test --select tag:metrics + metric comparison script for verification. Output: markdown, command, checklist.
- adr-documentation-diagnose: Diagnose a problem in "Architecture Decision Records". The failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done." is a likely candidate. Isolate the root cause with minimal experiments. Use adr-tools list + adr-tools generate + decision log index page for verification. Output: markdown, command, checklist.
- aws-lambda-cold-start-diagnose: Diagnose a problem in "AWS Lambda Cold Starts". The failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler." is a likely candidate. Isolate the root cause with minimal experiments. Use AWS X-Ray trace + Lambda Insights + cold start dashboard for verification. Output: markdown, command, checklist.
- azure-bicep-diagnose: Diagnose a problem in "Azure Bicep Infrastructure". The failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce." is a likely candidate. Isolate the root cause with minimal experiments. Use az deployment group validate + az what-if + bicep build for verification. Output: markdown, command, checklist.
- browser-devtools-diagnose: Diagnose a problem in "Browser DevTools & Debugging". The failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically." is a likely candidate. Isolate the root cause with minimal experiments. Use Chrome DevTools performance recording + memory heap snapshot + network throttle for verification. Output: markdown, command, checklist.
- cli-tool-design-diagnose: Diagnose a problem in "CLI Tool Design Patterns". The failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with." is a likely candidate. Isolate the root cause with minimal experiments. Use echo $? after CLI run + stderr redirection test + --json output validation for verification. Output: markdown, command, checklist.
- cloud-cost-optimization-diagnose: Diagnose a problem in "Cloud Cost Optimisation". The failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours." is a likely candidate. Isolate the root cause with minimal experiments. Use cloud cost explorer + instance utilisation report + auto-stop Lambda function test for verification. Output: markdown, command, checklist.
- code-review-checklist-diagnose: Diagnose a problem in "Code Review Checklist". The failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions." is a likely candidate. Isolate the root cause with minimal experiments. Use git diff --stat + lint-staged + danger.js automated review + commitlint for verification. Output: markdown, command, checklist.
- convex-functions-diagnose: Diagnose a problem in "Convex Functions & Mutations". The failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients." is a likely candidate. Isolate the root cause with minimal experiments. Use npx convex dev + dashboard OCC conflict log + custom retry logic for verification. Output: markdown, command, checklist.
- cron-job-reliability-diagnose: Diagnose a problem in "Cron Job & Scheduled Task Reliability". The failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time." is a likely candidate. Isolate the root cause with minimal experiments. Use tail -f /var/log/cron + systemctl status cron + idempotency test script for verification. Output: markdown, command, checklist.
- css-layout-diagnose: Diagnose a problem in "CSS Layout & Responsiveness". The failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable." is a likely candidate. Isolate the root cause with minimal experiments. Use Lighthouse mobile emulation + browser DevTools responsive mode for verification. Output: markdown, command, checklist.
- csv-data-cleaning-diagnose: Diagnose a problem in "CSV Data Cleaning Pipeline". The failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines." is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -c csv.DictReader + validation script + row count diff for verification. Output: markdown, command, checklist.
- database-migration-safety-diagnose: Diagnose a problem in "Database Migration Safety". The failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users." is a likely candidate. Isolate the root cause with minimal experiments. Use pg_locks monitoring during migration + batch backfill script + rollback test for verification. Output: markdown, command, checklist.
- data-warehouse-schema-diagnose: Diagnose a problem in "Data Warehouse Schema Design". The failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries." is a likely candidate. Isolate the root cause with minimal experiments. Use dbt run + dbt test + query profiling with warehouse-native tools for verification. Output: markdown, command, checklist.
- design-token-system-diagnose: Diagnose a problem in "Design Token Systems". The failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file." is a likely candidate. Isolate the root cause with minimal experiments. Use style-dictionary build + Storybook token viewer + token value comparison for verification. Output: markdown, command, checklist.
- docker-compose-networking-diagnose: Diagnose a problem in "Docker Compose Networking". The failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name." is a likely candidate. Isolate the root cause with minimal experiments. Use docker compose up --wait + docker network inspect + container logs for verification. Output: markdown, command, checklist.
- docker-multistage-diagnose: Diagnose a problem in "Docker Multi-Stage Builds". The failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure." is a likely candidate. Isolate the root cause with minimal experiments. Use docker build + docker scout + dive layer analysis for verification. Output: markdown, command, checklist.
- drizzle-schema-design-diagnose: Diagnose a problem in "Drizzle Schema Design". The failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster." is a likely candidate. Isolate the root cause with minimal experiments. Use drizzle-kit push + drizzle-kit studio + generated SQL audit for verification. Output: markdown, command, checklist.
- error-monitoring-setup-diagnose: Diagnose a problem in "Error Monitoring & Alerting Setup". The failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains." is a likely candidate. Isolate the root cause with minimal experiments. Use Sentry API error list + alert rule test + source map validation for verification. Output: markdown, command, checklist.
- fastapi-dependencies-diagnose: Diagnose a problem in "FastAPI Dependency Injection". The failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection." is a likely candidate. Isolate the root cause with minimal experiments. Use uvicorn --reload + /docs interactive test + dependency graph visualisation for verification. Output: markdown, command, checklist.
- feature-flags-diagnose: Diagnose a problem in "Feature Flags & Gradual Rollouts". The failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags." is a likely candidate. Isolate the root cause with minimal experiments. Use flag evaluation log + rollout percentage monitoring + unused flag scan for verification. Output: markdown, command, checklist.
- git-conflict-resolution-diagnose: Diagnose a problem in "Git Conflict Resolution". The failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs." is a likely candidate. Isolate the root cause with minimal experiments. Use git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere for verification. Output: markdown, command, checklist.
- github-actions-pipeline-diagnose: Diagnose a problem in "GitHub Actions Pipeline Optimisation". The failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope." is a likely candidate. Isolate the root cause with minimal experiments. Use act --job test + cache hit/miss analysis + workflow graph visualisation for verification. Output: markdown, command, checklist.
- graphql-n-plus-one-diagnose: Diagnose a problem in "GraphQL N+1 Query Prevention". The failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children." is a likely candidate. Isolate the root cause with minimal experiments. Use graphql query with tracing + DataLoader statistics + SQL log analysis for verification. Output: markdown, command, checklist.
- jest-test-optimization-diagnose: Diagnose a problem in "Jest Test Optimisation". The failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes." is a likely candidate. Isolate the root cause with minimal experiments. Use jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check for verification. Output: markdown, command, checklist.
- json-schema-validation-diagnose: Diagnose a problem in "JSON Schema Validation". The failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly." is a likely candidate. Isolate the root cause with minimal experiments. Use ajv validate + JSON Schema test suite + response mock test for verification. Output: markdown, command, checklist.
- kubernetes-hpa-diagnose: Diagnose a problem in "Kubernetes Horizontal Pod Autoscaling". The failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment." is a likely candidate. Isolate the root cause with minimal experiments. Use kubectl get hpa --watch + kubectl top pods + metrics-server logs for verification. Output: markdown, command, checklist.
- kubernetes-pod-lifecycle-diagnose: Diagnose a problem in "Kubernetes Pod Lifecycle". The failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready." is a likely candidate. Isolate the root cause with minimal experiments. Use kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' for verification. Output: markdown, command, checklist.
- context-window-budget-diagnose: Diagnose a problem in "LLM Context Window Budget Management". The failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness." is a likely candidate. Isolate the root cause with minimal experiments. Use tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry for verification. Output: markdown, command.
- mcp-tool-design-diagnose: Diagnose a problem in "MCP Tool Design & Best Practices". The failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent." is a likely candidate. Isolate the root cause with minimal experiments. Use mcp-cli run + mcp inspector + tool name conflict analysis for verification. Output: markdown, command, checklist.
- message-queues-diagnose: Diagnose a problem in "Message Queues & Background Jobs". The failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled." is a likely candidate. Isolate the root cause with minimal experiments. Use Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection for verification. Output: markdown, command, checklist.
- multi-tenant-isolation-diagnose: Diagnose a problem in "Multi-Tenant Data Isolation". The failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data." is a likely candidate. Isolate the root cause with minimal experiments. Use RLS policy test with two different tenant sessions + data leakage check for verification. Output: markdown, command, checklist.
- nextjs-api-routes-diagnose: Diagnose a problem in "Next.js API Routes & Route Handlers". The failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component." is a likely candidate. Isolate the root cause with minimal experiments. Use curl --verbose + API route error log + status code audit for verification. Output: markdown, command, checklist.
- nextjs-data-fetching-diagnose: Diagnose a problem in "Next.js Data Fetching Patterns". The failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests." is a likely candidate. Isolate the root cause with minimal experiments. Use next build --debug + React DevTools fetch profiling for verification. Output: markdown, command, checklist.
- nextjs-middleware-diagnose: Diagnose a problem in "Next.js Middleware & Edge Runtime". The failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes." is a likely candidate. Isolate the root cause with minimal experiments. Use next dev + curl --cookie tests + edge runtime log inspection for verification. Output: markdown, command, checklist.
- node-error-handling-diagnose: Diagnose a problem in "Node.js Error Handling & Resilience". The failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context." is a likely candidate. Isolate the root cause with minimal experiments. Use node --unhandled-rejections=strict + process.on('uncaughtException') log for verification. Output: markdown, command, checklist.
- node-streams-diagnose: Diagnose a problem in "Node.js Streams & Backpressure". The failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams." is a likely candidate. Isolate the root cause with minimal experiments. Use Node.js --inspect memory heap snapshot + stream highWaterMark tuning for verification. Output: markdown, command, checklist.
- oauth-flows-diagnose: Diagnose a problem in "OAuth 2.0 Flows & Token Management". The failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation." is a likely candidate. Isolate the root cause with minimal experiments. Use oauth2_proxy + jwt.io debugger + curl --cookie with token inspection for verification. Output: markdown, command, checklist.
- openapi-spec-diagnose: Diagnose a problem in "OpenAPI Specification & Validation". The failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code." is a likely candidate. Isolate the root cause with minimal experiments. Use redocly lint + openapi-diff + swagger-ui preview for verification. Output: markdown, command, checklist.
- playwright-selectors-diagnose: Diagnose a problem in "Playwright Selectors & Locators". The failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update." is a likely candidate. Isolate the root cause with minimal experiments. Use playwright test --reporter=html + playwright codegen + trace viewer for verification. Output: markdown, command, checklist.
- prompt-injection-defense-diagnose: Diagnose a problem in "Prompt Injection Defense". The failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'." is a likely candidate. Isolate the root cause with minimal experiments. Use prompt injection test suite + adversarial input fuzzing + output scanner for verification. Output: markdown, command, checklist.
- python-async-diagnose: Diagnose a problem in "Python Async/Await Patterns". The failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions." is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -m asyncio + aiohttp/httpx async benchmark for verification. Output: markdown, command, checklist.
- python-file-io-diagnose: Diagnose a problem in "Python File I/O & Encoding". The failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content." is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -c with open() + chardet encoding detection for verification. Output: markdown, command, checklist.
- rag-chunking-diagnose: Diagnose a problem in "RAG Chunking Strategies". The failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality." is a likely candidate. Isolate the root cause with minimal experiments. Use retrieval evaluation script + chunk boundary visualisation + recall@k measurement for verification. Output: markdown, command, checklist.
- rate-limiting-proxy-diagnose: Diagnose a problem in "Rate Limiting & API Gateway Proxy". The failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources." is a likely candidate. Isolate the root cause with minimal experiments. Use ab -n 1000 -c 10 + nginx error log + 429 response code monitoring for verification. Output: markdown, command, checklist.
- react-server-components-diagnose: Diagnose a problem in "React Server Components". The failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file." is a likely candidate. Isolate the root cause with minimal experiments. Use next build --debug + React Server Components lint rule for verification. Output: markdown, command, checklist.
- react-state-diagnose: Diagnose a problem in "React State Management". The failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation." is a likely candidate. Isolate the root cause with minimal experiments. Use React DevTools profiler + why-did-you-render for verification. Output: markdown, command, checklist.
- redis-caching-diagnose: Diagnose a problem in "Redis Caching Strategies". The failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time." is a likely candidate. Isolate the root cause with minimal experiments. Use redis-cli --stat + cache hit ratio monitoring + slow log for verification. Output: markdown, command, checklist.
- rest-pagination-diagnose: Diagnose a problem in "REST Pagination Design". The failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows." is a likely candidate. Isolate the root cause with minimal experiments. Use curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark for verification. Output: markdown, command, checklist.
- secrets-rotation-diagnose: Diagnose a problem in "Secrets Rotation Policy". The failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak." is a likely candidate. Isolate the root cause with minimal experiments. Use vault lease list + secret expiry check + rotation dry-run test for verification. Output: markdown, command, checklist.
- shell-script-robustness-diagnose: Diagnose a problem in "Shell Script Robustness & Safety". The failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage." is a likely candidate. Isolate the root cause with minimal experiments. Use shellcheck script.sh + bash -n script.sh + dry-run mode test for verification. Output: markdown, command, checklist.
- sql-query-optimization-diagnose: Diagnose a problem in "SQL Query Optimisation". The failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs." is a likely candidate. Isolate the root cause with minimal experiments. Use EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query for verification. Output: markdown, command, checklist.
- stealth-web-research-diagnose: Diagnose a problem in "Stealth Web Research & Harvesting". The failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests." is a likely candidate. Isolate the root cause with minimal experiments. Use playwright-extra + stealth + cheerio + defuddle + manual jq inspection for verification. Output: markdown, command, checklist.
- stripe-webhook-idempotency-diagnose: Diagnose a problem in "Stripe Webhook Idempotency". The failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations." is a likely candidate. Isolate the root cause with minimal experiments. Use stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check for verification. Output: markdown, command, checklist.
- supabase-rls-diagnose: Diagnose a problem in "Supabase Row-Level Security". The failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data." is a likely candidate. Isolate the root cause with minimal experiments. Use supabase db check + supabase db test + RLS policy review with pg_policies for verification. Output: markdown, command, checklist.
- terraform-state-diagnose: Diagnose a problem in "Terraform State Management". The failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure." is a likely candidate. Isolate the root cause with minimal experiments. Use terraform plan + terraform state list + terraform state pull | jq for verification. Output: markdown, command, checklist.
- typescript-generics-diagnose: Diagnose a problem in "TypeScript Generics & Advanced Types". The failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)." is a likely candidate. Isolate the root cause with minimal experiments. Use tsc --noEmit --strict + type tests with expect-type for verification. Output: markdown, command, checklist.
- user-onboarding-flow-diagnose: Diagnose a problem in "User Onboarding Flow Design". The failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value." is a likely candidate. Isolate the root cause with minimal experiments. Use analytics funnel analysis + onboarding completion rate + drop-off heatmap for verification. Output: markdown, command, checklist.
- vercel-env-vars-diagnose: Diagnose a problem in "Vercel Environment Variables". The failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments." is a likely candidate. Isolate the root cause with minimal experiments. Use vercel env pull + vercel list + project settings audit for verification. Output: markdown, command, checklist.
- web-scraping-ethics-diagnose: Diagnose a problem in "Web Scraping Ethics & Compliance". The failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues." is a likely candidate. Isolate the root cause with minimal experiments. Use curl robots.txt + wget --wait + scraper log audit for verification. Output: markdown, command, checklist.
- websocket-reconnection-diagnose: Diagnose a problem in "WebSocket Reconnection Strategies". The failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state." is a likely candidate. Isolate the root cause with minimal experiments. Use Browser DevTools Network tab WS filter + reconnection test with server restart for verification. Output: markdown, command, checklist.
- web-vitals-optimization-diagnose: Diagnose a problem in "Web Vitals Optimisation (LCP/CLS/INP)". The failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)." is a likely candidate. Isolate the root cause with minimal experiments. Use Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension for verification. Output: markdown, command, checklist.
- a-b-testing-framework-explain: Write documentation for "A/B Testing Framework". Cover: what it is, when to use it, the Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise. pitfall, and how to verify with statsmodels sample size calculation + Bayesian A/B test + sequential testing. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- a11y-aria-patterns-explain: Write documentation for "Accessibility ARIA Patterns". Cover: what it is, when to use it, the Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers. pitfall, and how to verify with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- agent-tool-binding-explain: Write documentation for "Agent Tool Binding & Dispatch". Cover: what it is, when to use it, the Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly. pitfall, and how to verify with agent trace log + tool invocation frequency analysis + token cost audit. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- analytics-metric-definition-explain: Write documentation for "Analytics Metric Definitions". Cover: what it is, when to use it, the Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers. pitfall, and how to verify with dbt docs generate + dbt test --select tag:metrics + metric comparison script. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- adr-documentation-explain: Write documentation for "Architecture Decision Records". Cover: what it is, when to use it, the Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done. pitfall, and how to verify with adr-tools list + adr-tools generate + decision log index page. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- aws-lambda-cold-start-explain: Write documentation for "AWS Lambda Cold Starts". Cover: what it is, when to use it, the Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler. pitfall, and how to verify with AWS X-Ray trace + Lambda Insights + cold start dashboard. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- azure-bicep-explain: Write documentation for "Azure Bicep Infrastructure". Cover: what it is, when to use it, the Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce. pitfall, and how to verify with az deployment group validate + az what-if + bicep build. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- browser-devtools-explain: Write documentation for "Browser DevTools & Debugging". Cover: what it is, when to use it, the Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically. pitfall, and how to verify with Chrome DevTools performance recording + memory heap snapshot + network throttle. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- cli-tool-design-explain: Write documentation for "CLI Tool Design Patterns". Cover: what it is, when to use it, the Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with. pitfall, and how to verify with echo $? after CLI run + stderr redirection test + --json output validation. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- cloud-cost-optimization-explain: Write documentation for "Cloud Cost Optimisation". Cover: what it is, when to use it, the Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours. pitfall, and how to verify with cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- code-review-checklist-explain: Write documentation for "Code Review Checklist". Cover: what it is, when to use it, the Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions. pitfall, and how to verify with git diff --stat + lint-staged + danger.js automated review + commitlint. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- convex-functions-explain: Write documentation for "Convex Functions & Mutations". Cover: what it is, when to use it, the Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients. pitfall, and how to verify with npx convex dev + dashboard OCC conflict log + custom retry logic. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- cron-job-reliability-explain: Write documentation for "Cron Job & Scheduled Task Reliability". Cover: what it is, when to use it, the Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time. pitfall, and how to verify with tail -f /var/log/cron + systemctl status cron + idempotency test script. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- css-layout-explain: Write documentation for "CSS Layout & Responsiveness". Cover: what it is, when to use it, the Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable. pitfall, and how to verify with Lighthouse mobile emulation + browser DevTools responsive mode. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- csv-data-cleaning-explain: Write documentation for "CSV Data Cleaning Pipeline". Cover: what it is, when to use it, the Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines. pitfall, and how to verify with python3 -c csv.DictReader + validation script + row count diff. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- database-migration-safety-explain: Write documentation for "Database Migration Safety". Cover: what it is, when to use it, the Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users. pitfall, and how to verify with pg_locks monitoring during migration + batch backfill script + rollback test. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- data-warehouse-schema-explain: Write documentation for "Data Warehouse Schema Design". Cover: what it is, when to use it, the Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries. pitfall, and how to verify with dbt run + dbt test + query profiling with warehouse-native tools. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- design-token-system-explain: Write documentation for "Design Token Systems". Cover: what it is, when to use it, the Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file. pitfall, and how to verify with style-dictionary build + Storybook token viewer + token value comparison. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- docker-compose-networking-explain: Write documentation for "Docker Compose Networking". Cover: what it is, when to use it, the Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name. pitfall, and how to verify with docker compose up --wait + docker network inspect + container logs. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- docker-multistage-explain: Write documentation for "Docker Multi-Stage Builds". Cover: what it is, when to use it, the Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure. pitfall, and how to verify with docker build + docker scout + dive layer analysis. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- drizzle-schema-design-explain: Write documentation for "Drizzle Schema Design". Cover: what it is, when to use it, the Over-using relations() when simple foreign key columns with manual joins would be clearer and faster. pitfall, and how to verify with drizzle-kit push + drizzle-kit studio + generated SQL audit. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- error-monitoring-setup-explain: Write documentation for "Error Monitoring & Alerting Setup". Cover: what it is, when to use it, the Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains. pitfall, and how to verify with Sentry API error list + alert rule test + source map validation. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- fastapi-dependencies-explain: Write documentation for "FastAPI Dependency Injection". Cover: what it is, when to use it, the Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection. pitfall, and how to verify with uvicorn --reload + /docs interactive test + dependency graph visualisation. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- feature-flags-explain: Write documentation for "Feature Flags & Gradual Rollouts". Cover: what it is, when to use it, the Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags. pitfall, and how to verify with flag evaluation log + rollout percentage monitoring + unused flag scan. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- git-conflict-resolution-explain: Write documentation for "Git Conflict Resolution". Cover: what it is, when to use it, the Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs. pitfall, and how to verify with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- github-actions-pipeline-explain: Write documentation for "GitHub Actions Pipeline Optimisation". Cover: what it is, when to use it, the Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope. pitfall, and how to verify with act --job test + cache hit/miss analysis + workflow graph visualisation. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- graphql-n-plus-one-explain: Write documentation for "GraphQL N+1 Query Prevention". Cover: what it is, when to use it, the A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children. pitfall, and how to verify with graphql query with tracing + DataLoader statistics + SQL log analysis. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- jest-test-optimization-explain: Write documentation for "Jest Test Optimisation". Cover: what it is, when to use it, the Running the entire test suite on every change, taking minutes even for small incremental code changes. pitfall, and how to verify with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- json-schema-validation-explain: Write documentation for "JSON Schema Validation". Cover: what it is, when to use it, the Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly. pitfall, and how to verify with ajv validate + JSON Schema test suite + response mock test. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- kubernetes-hpa-explain: Write documentation for "Kubernetes Horizontal Pod Autoscaling". Cover: what it is, when to use it, the HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment. pitfall, and how to verify with kubectl get hpa --watch + kubectl top pods + metrics-server logs. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- kubernetes-pod-lifecycle-explain: Write documentation for "Kubernetes Pod Lifecycle". Cover: what it is, when to use it, the Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready. pitfall, and how to verify with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- mcp-tool-design-explain: Write documentation for "MCP Tool Design & Best Practices". Cover: what it is, when to use it, the Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent. pitfall, and how to verify with mcp-cli run + mcp inspector + tool name conflict analysis. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- message-queues-explain: Write documentation for "Message Queues & Background Jobs". Cover: what it is, when to use it, the Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled. pitfall, and how to verify with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- multi-tenant-isolation-explain: Write documentation for "Multi-Tenant Data Isolation". Cover: what it is, when to use it, the Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data. pitfall, and how to verify with RLS policy test with two different tenant sessions + data leakage check. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- nextjs-api-routes-explain: Write documentation for "Next.js API Routes & Route Handlers". Cover: what it is, when to use it, the Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component. pitfall, and how to verify with curl --verbose + API route error log + status code audit. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- nextjs-data-fetching-explain: Write documentation for "Next.js Data Fetching Patterns". Cover: what it is, when to use it, the Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests. pitfall, and how to verify with next build --debug + React DevTools fetch profiling. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- nextjs-middleware-explain: Write documentation for "Next.js Middleware & Edge Runtime". Cover: what it is, when to use it, the Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes. pitfall, and how to verify with next dev + curl --cookie tests + edge runtime log inspection. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- node-error-handling-explain: Write documentation for "Node.js Error Handling & Resilience". Cover: what it is, when to use it, the Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context. pitfall, and how to verify with node --unhandled-rejections=strict + process.on('uncaughtException') log. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- node-streams-explain: Write documentation for "Node.js Streams & Backpressure". Cover: what it is, when to use it, the Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams. pitfall, and how to verify with Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- oauth-flows-explain: Write documentation for "OAuth 2.0 Flows & Token Management". Cover: what it is, when to use it, the Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation. pitfall, and how to verify with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- openapi-spec-explain: Write documentation for "OpenAPI Specification & Validation". Cover: what it is, when to use it, the Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code. pitfall, and how to verify with redocly lint + openapi-diff + swagger-ui preview. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- playwright-selectors-explain: Write documentation for "Playwright Selectors & Locators". Cover: what it is, when to use it, the Using fragile CSS selectors (nth-child, class names that change) that break on every UI update. pitfall, and how to verify with playwright test --reporter=html + playwright codegen + trace viewer. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- prompt-injection-defense-explain: Write documentation for "Prompt Injection Defense". Cover: what it is, when to use it, the Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'. pitfall, and how to verify with prompt injection test suite + adversarial input fuzzing + output scanner. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- python-async-explain: Write documentation for "Python Async/Await Patterns". Cover: what it is, when to use it, the Blocking the event loop by using synchronous requests or time.sleep inside async functions. pitfall, and how to verify with python3 -m asyncio + aiohttp/httpx async benchmark. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- python-file-io-explain: Write documentation for "Python File I/O & Encoding". Cover: what it is, when to use it, the Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content. pitfall, and how to verify with python3 -c with open() + chardet encoding detection. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- rag-chunking-explain: Write documentation for "RAG Chunking Strategies". Cover: what it is, when to use it, the Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality. pitfall, and how to verify with retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- rate-limiting-proxy-explain: Write documentation for "Rate Limiting & API Gateway Proxy". Cover: what it is, when to use it, the Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources. pitfall, and how to verify with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- react-server-components-explain: Write documentation for "React Server Components". Cover: what it is, when to use it, the Accidentally making a server component a client component by using hooks or event handlers in the wrong file. pitfall, and how to verify with next build --debug + React Server Components lint rule. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- react-state-explain: Write documentation for "React State Management". Cover: what it is, when to use it, the Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation. pitfall, and how to verify with React DevTools profiler + why-did-you-render. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- redis-caching-explain: Write documentation for "Redis Caching Strategies". Cover: what it is, when to use it, the Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time. pitfall, and how to verify with redis-cli --stat + cache hit ratio monitoring + slow log. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- rest-pagination-explain: Write documentation for "REST Pagination Design". Cover: what it is, when to use it, the Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows. pitfall, and how to verify with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- secrets-rotation-explain: Write documentation for "Secrets Rotation Policy". Cover: what it is, when to use it, the Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak. pitfall, and how to verify with vault lease list + secret expiry check + rotation dry-run test. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- shell-script-robustness-explain: Write documentation for "Shell Script Robustness & Safety". Cover: what it is, when to use it, the Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage. pitfall, and how to verify with shellcheck script.sh + bash -n script.sh + dry-run mode test. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- sql-query-optimization-explain: Write documentation for "SQL Query Optimisation". Cover: what it is, when to use it, the Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs. pitfall, and how to verify with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- stealth-web-research-explain: Write documentation for "Stealth Web Research & Harvesting". Cover: what it is, when to use it, the Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests. pitfall, and how to verify with playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- stripe-webhook-idempotency-explain: Write documentation for "Stripe Webhook Idempotency". Cover: what it is, when to use it, the Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations. pitfall, and how to verify with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- supabase-rls-explain: Write documentation for "Supabase Row-Level Security". Cover: what it is, when to use it, the RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data. pitfall, and how to verify with supabase db check + supabase db test + RLS policy review with pg_policies. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- terraform-state-explain: Write documentation for "Terraform State Management". Cover: what it is, when to use it, the Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure. pitfall, and how to verify with terraform plan + terraform state list + terraform state pull | jq. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- typescript-generics-explain: Write documentation for "TypeScript Generics & Advanced Types". Cover: what it is, when to use it, the Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice). pitfall, and how to verify with tsc --noEmit --strict + type tests with expect-type. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- user-onboarding-flow-explain: Write documentation for "User Onboarding Flow Design". Cover: what it is, when to use it, the Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value. pitfall, and how to verify with analytics funnel analysis + onboarding completion rate + drop-off heatmap. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- vercel-env-vars-explain: Write documentation for "Vercel Environment Variables". Cover: what it is, when to use it, the Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments. pitfall, and how to verify with vercel env pull + vercel list + project settings audit. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- web-scraping-ethics-explain: Write documentation for "Web Scraping Ethics & Compliance". Cover: what it is, when to use it, the Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues. pitfall, and how to verify with curl robots.txt + wget --wait + scraper log audit. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- websocket-reconnection-explain: Write documentation for "WebSocket Reconnection Strategies". Cover: what it is, when to use it, the Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state. pitfall, and how to verify with Browser DevTools Network tab WS filter + reconnection test with server restart. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- web-vitals-optimization-explain: Write documentation for "Web Vitals Optimisation (LCP/CLS/INP)". Cover: what it is, when to use it, the Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions). pitfall, and how to verify with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Output must be readable by both humans and AI agents. Output: markdown, checklist.
- context-window-budget-explain: Write documentation for "LLM Context Window Budget Management". Cover: what it is, when to use it, the Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness. pitfall, and how to verify with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Output must be readable by both humans and AI agents. Output: markdown.
- codebase-navigator: Call this before writing any code in an unfamiliar repository or before modifying a system you have not fully explored. Output: markdown, checklist.
- implementation-sprint: Call this after a plan is approved and you are ready to start writing or editing code. Output: markdown, checklist.
- a-b-testing-framework-build: Write or modify code for "A/B Testing Framework". The typical output is experiment spec / variant assignment / metric definition / statistical analysis script. Keep the best practice in mind: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Verify with: statsmodels sample size calculation + Bayesian A/B test + sequential testing. Output: diff, checklist.
- a11y-aria-patterns-build: Write or modify code for "Accessibility ARIA Patterns". The typical output is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Keep the best practice in mind: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Verify with: axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Output: diff, checklist.
- agent-tool-binding-build: Write or modify code for "Agent Tool Binding & Dispatch". The typical output is router tool / domain group / dynamic tool injection / tool usage statistics. Keep the best practice in mind: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Verify with: agent trace log + tool invocation frequency analysis + token cost audit. Output: diff, checklist.
- analytics-metric-definition-build: Write or modify code for "Analytics Metric Definitions". The typical output is metric definition / dbt model / SQL logic / dashboard tile / documentation. Keep the best practice in mind: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Verify with: dbt docs generate + dbt test --select tag:metrics + metric comparison script. Output: diff, checklist.
- adr-documentation-build: Write or modify code for "Architecture Decision Records". The typical output is ADR document / decision log / template / review workflow. Keep the best practice in mind: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Verify with: adr-tools list + adr-tools generate + decision log index page. Output: diff, checklist.
- aws-lambda-cold-start-build: Write or modify code for "AWS Lambda Cold Starts". The typical output is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Keep the best practice in mind: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Verify with: AWS X-Ray trace + Lambda Insights + cold start dashboard. Output: diff, checklist.
- azure-bicep-build: Write or modify code for "Azure Bicep Infrastructure". The typical output is main.bicep / module / parameter file / azd template. Keep the best practice in mind: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Verify with: az deployment group validate + az what-if + bicep build. Output: diff, checklist.
- browser-devtools-build: Write or modify code for "Browser DevTools & Debugging". The typical output is debugging workflow / breakpoint guide / performance recording / memory snapshot. Keep the best practice in mind: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Verify with: Chrome DevTools performance recording + memory heap snapshot + network throttle. Output: diff, checklist.
- cli-tool-design-build: Write or modify code for "CLI Tool Design Patterns". The typical output is CLI scaffolding / argument parser / exit code handler / --json output mode. Keep the best practice in mind: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Verify with: echo $? after CLI run + stderr redirection test + --json output validation. Output: diff, checklist.
- cloud-cost-optimization-build: Write or modify code for "Cloud Cost Optimisation". The typical output is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Keep the best practice in mind: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Verify with: cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Output: diff, checklist.
- code-review-checklist-build: Write or modify code for "Code Review Checklist". The typical output is review checklist / automated review comment / risk classification / diff summary. Keep the best practice in mind: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Verify with: git diff --stat + lint-staged + danger.js automated review + commitlint. Output: diff, checklist.
- convex-functions-build: Write or modify code for "Convex Functions & Mutations". The typical output is mutation / query / action / component / scheduler job. Keep the best practice in mind: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Verify with: npx convex dev + dashboard OCC conflict log + custom retry logic. Output: diff, checklist.
- cron-job-reliability-build: Write or modify code for "Cron Job & Scheduled Task Reliability". The typical output is crontab entry / log rotation / idempotency guard / failure alert integration. Keep the best practice in mind: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Verify with: tail -f /var/log/cron + systemctl status cron + idempotency test script. Output: diff, checklist.
- css-layout-build: Write or modify code for "CSS Layout & Responsiveness". The typical output is CSS layout refactor / responsive grid / container query implementation. Keep the best practice in mind: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Verify with: Lighthouse mobile emulation + browser DevTools responsive mode. Output: diff, checklist.
- csv-data-cleaning-build: Write or modify code for "CSV Data Cleaning Pipeline". The typical output is CSV parser / row validator / column type mapper / error report / cleaned output. Keep the best practice in mind: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Verify with: python3 -c csv.DictReader + validation script + row count diff. Output: diff, checklist.
- database-migration-safety-build: Write or modify code for "Database Migration Safety". The typical output is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Keep the best practice in mind: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Verify with: pg_locks monitoring during migration + batch backfill script + rollback test. Output: diff, checklist.
- data-warehouse-schema-build: Write or modify code for "Data Warehouse Schema Design". The typical output is star schema / fact table / dimension table / ETL pipeline spec. Keep the best practice in mind: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Verify with: dbt run + dbt test + query profiling with warehouse-native tools. Output: diff, checklist.
- design-token-system-build: Write or modify code for "Design Token Systems". The typical output is token JSON / CSS custom properties / theme switcher / token documentation. Keep the best practice in mind: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Verify with: style-dictionary build + Storybook token viewer + token value comparison. Output: diff, checklist.
- docker-compose-networking-build: Write or modify code for "Docker Compose Networking". The typical output is docker-compose.yml / network config / healthcheck / depends_on condition. Keep the best practice in mind: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Verify with: docker compose up --wait + docker network inspect + container logs. Output: diff, checklist.
- docker-multistage-build: Write or modify code for "Docker Multi-Stage Builds". The typical output is multi-stage Dockerfile / .dockerignore / slim base image switch. Keep the best practice in mind: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Verify with: docker build + docker scout + dive layer analysis. Output: diff, checklist.
- drizzle-schema-design-build: Write or modify code for "Drizzle Schema Design". The typical output is schema.ts / relation map / migration SQL / Drizzle query builder. Keep the best practice in mind: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Verify with: drizzle-kit push + drizzle-kit studio + generated SQL audit. Output: diff, checklist.
- error-monitoring-setup-build: Write or modify code for "Error Monitoring & Alerting Setup". The typical output is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Keep the best practice in mind: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Verify with: Sentry API error list + alert rule test + source map validation. Output: diff, checklist.
- fastapi-dependencies-build: Write or modify code for "FastAPI Dependency Injection". The typical output is dependency / lifespan handler / override for testing. Keep the best practice in mind: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Verify with: uvicorn --reload + /docs interactive test + dependency graph visualisation. Output: diff, checklist.
- feature-flags-build: Write or modify code for "Feature Flags & Gradual Rollouts". The typical output is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Keep the best practice in mind: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Verify with: flag evaluation log + rollout percentage monitoring + unused flag scan. Output: diff, checklist.
- git-conflict-resolution-build: Write or modify code for "Git Conflict Resolution". The typical output is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Keep the best practice in mind: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Verify with: git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Output: diff, checklist.
- github-actions-pipeline-build: Write or modify code for "GitHub Actions Pipeline Optimisation". The typical output is workflow YAML / cache config / matrix build / conditional job execution. Keep the best practice in mind: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Verify with: act --job test + cache hit/miss analysis + workflow graph visualisation. Output: diff, checklist.
- graphql-n-plus-one-build: Write or modify code for "GraphQL N+1 Query Prevention". The typical output is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Keep the best practice in mind: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Verify with: graphql query with tracing + DataLoader statistics + SQL log analysis. Output: diff, checklist.
- jest-test-optimization-build: Write or modify code for "Jest Test Optimisation". The typical output is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Keep the best practice in mind: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Verify with: jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Output: diff, checklist.
- json-schema-validation-build: Write or modify code for "JSON Schema Validation". The typical output is JSON Schema / validator middleware / type guard / error message / response parser. Keep the best practice in mind: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Verify with: ajv validate + JSON Schema test suite + response mock test. Output: diff, checklist.
- kubernetes-hpa-build: Write or modify code for "Kubernetes Horizontal Pod Autoscaling". The typical output is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Keep the best practice in mind: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Verify with: kubectl get hpa --watch + kubectl top pods + metrics-server logs. Output: diff, checklist.
- kubernetes-pod-lifecycle-build: Write or modify code for "Kubernetes Pod Lifecycle". The typical output is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Keep the best practice in mind: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Verify with: kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Output: diff, checklist.
- context-window-budget-build: Write or modify code for "LLM Context Window Budget Management". The typical output is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Keep the best practice in mind: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Verify with: tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Output: markdown, diff, command.
- mcp-tool-design-build: Write or modify code for "MCP Tool Design & Best Practices". The typical output is MCP tool descriptor / resource definition / prompt template / server metadata. Keep the best practice in mind: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Verify with: mcp-cli run + mcp inspector + tool name conflict analysis. Output: diff, checklist.
- message-queues-build: Write or modify code for "Message Queues & Background Jobs". The typical output is queue producer / worker / dead-letter handler / retry policy. Keep the best practice in mind: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Verify with: Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Output: diff, checklist.
- multi-tenant-isolation-build: Write or modify code for "Multi-Tenant Data Isolation". The typical output is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Keep the best practice in mind: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Verify with: RLS policy test with two different tenant sessions + data leakage check. Output: diff, checklist.
- nextjs-api-routes-build: Write or modify code for "Next.js API Routes & Route Handlers". The typical output is route.ts handler / server action / API client wrapper / error boundary. Keep the best practice in mind: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Verify with: curl --verbose + API route error log + status code audit. Output: diff, checklist.
- nextjs-data-fetching-build: Write or modify code for "Next.js Data Fetching Patterns". The typical output is server fetch / React cache wrapper / streaming suspense boundary. Keep the best practice in mind: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Verify with: next build --debug + React DevTools fetch profiling. Output: diff, checklist.
- nextjs-middleware-build: Write or modify code for "Next.js Middleware & Edge Runtime". The typical output is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Keep the best practice in mind: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Verify with: next dev + curl --cookie tests + edge runtime log inspection. Output: diff, checklist.
- node-error-handling-build: Write or modify code for "Node.js Error Handling & Resilience". The typical output is global error handler / async wrapper / structured error response / retry logic. Keep the best practice in mind: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Verify with: node --unhandled-rejections=strict + process.on('uncaughtException') log. Output: diff, checklist.
- node-streams-build: Write or modify code for "Node.js Streams & Backpressure". The typical output is Readable/Writable stream / Transform / pipeline() refactor. Keep the best practice in mind: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Verify with: Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Output: diff, checklist.
- oauth-flows-build: Write or modify code for "OAuth 2.0 Flows & Token Management". The typical output is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Keep the best practice in mind: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Verify with: oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Output: diff, checklist.
- openapi-spec-build: Write or modify code for "OpenAPI Specification & Validation". The typical output is openapi.yaml / code-first generator / request/response validation middleware. Keep the best practice in mind: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Verify with: redocly lint + openapi-diff + swagger-ui preview. Output: diff, checklist.
- playwright-selectors-build: Write or modify code for "Playwright Selectors & Locators". The typical output is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Keep the best practice in mind: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Verify with: playwright test --reporter=html + playwright codegen + trace viewer. Output: diff, checklist.
- prompt-injection-defense-build: Write or modify code for "Prompt Injection Defense". The typical output is defensive system prompt / input sanitizer / instruction guardrail / output validator. Keep the best practice in mind: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Verify with: prompt injection test suite + adversarial input fuzzing + output scanner. Output: diff, checklist.
- python-async-build: Write or modify code for "Python Async/Await Patterns". The typical output is async/await refactor / asyncio.gather / async context manager. Keep the best practice in mind: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Verify with: python3 -m asyncio + aiohttp/httpx async benchmark. Output: diff, checklist.
- python-file-io-build: Write or modify code for "Python File I/O & Encoding". The typical output is pathlib refactor / encoding-safe file reader / batch file processor. Keep the best practice in mind: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Verify with: python3 -c with open() + chardet encoding detection. Output: diff, checklist.
- rag-chunking-build: Write or modify code for "RAG Chunking Strategies". The typical output is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Keep the best practice in mind: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Verify with: retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Output: diff, checklist.
- rate-limiting-proxy-build: Write or modify code for "Rate Limiting & API Gateway Proxy". The typical output is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Keep the best practice in mind: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Verify with: ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Output: diff, checklist.
- react-server-components-build: Write or modify code for "React Server Components". The typical output is server component / client boundary refactor / streaming fallback. Keep the best practice in mind: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Verify with: next build --debug + React Server Components lint rule. Output: diff, checklist.
- react-state-build: Write or modify code for "React State Management". The typical output is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Keep the best practice in mind: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Verify with: React DevTools profiler + why-did-you-render. Output: diff, checklist.
- redis-caching-build: Write or modify code for "Redis Caching Strategies". The typical output is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Keep the best practice in mind: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Verify with: redis-cli --stat + cache hit ratio monitoring + slow log. Output: diff, checklist.
- rest-pagination-build: Write or modify code for "REST Pagination Design". The typical output is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Keep the best practice in mind: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Verify with: curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Output: diff, checklist.
- secrets-rotation-build: Write or modify code for "Secrets Rotation Policy". The typical output is rotation script / vault integration / lease management / incident response plan. Keep the best practice in mind: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Verify with: vault lease list + secret expiry check + rotation dry-run test. Output: diff, checklist.
- shell-script-robustness-build: Write or modify code for "Shell Script Robustness & Safety". The typical output is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Keep the best practice in mind: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Verify with: shellcheck script.sh + bash -n script.sh + dry-run mode test. Output: diff, checklist.
- sql-query-optimization-build: Write or modify code for "SQL Query Optimisation". The typical output is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Keep the best practice in mind: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Verify with: EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Output: diff, checklist.
- stealth-web-research-build: Write or modify code for "Stealth Web Research & Harvesting". The typical output is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Keep the best practice in mind: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Verify with: playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Output: diff, checklist.
- stripe-webhook-idempotency-build: Write or modify code for "Stripe Webhook Idempotency". The typical output is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Keep the best practice in mind: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Verify with: stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Output: diff, checklist.
- supabase-rls-build: Write or modify code for "Supabase Row-Level Security". The typical output is RLS policy / policy test / security definer function / admin bypass. Keep the best practice in mind: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Verify with: supabase db check + supabase db test + RLS policy review with pg_policies. Output: diff, checklist.
- terraform-state-build: Write or modify code for "Terraform State Management". The typical output is backend config / state migration plan / state locking config / remote state datasource. Keep the best practice in mind: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Verify with: terraform plan + terraform state list + terraform state pull | jq. Output: diff, checklist.
- typescript-generics-build: Write or modify code for "TypeScript Generics & Advanced Types". The typical output is generic type / conditional type / mapped type / branded type. Keep the best practice in mind: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Verify with: tsc --noEmit --strict + type tests with expect-type. Output: diff, checklist.
- user-onboarding-flow-build: Write or modify code for "User Onboarding Flow Design". The typical output is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Keep the best practice in mind: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Verify with: analytics funnel analysis + onboarding completion rate + drop-off heatmap. Output: diff, checklist.
- vercel-env-vars-build: Write or modify code for "Vercel Environment Variables". The typical output is vercel.json env group / preview env config / Edge Config / KV store. Keep the best practice in mind: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Verify with: vercel env pull + vercel list + project settings audit. Output: diff, checklist.
- web-scraping-ethics-build: Write or modify code for "Web Scraping Ethics & Compliance". The typical output is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Keep the best practice in mind: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Verify with: curl robots.txt + wget --wait + scraper log audit. Output: diff, checklist.
- websocket-reconnection-build: Write or modify code for "WebSocket Reconnection Strategies". The typical output is WebSocket client / reconnection logic / heartbeat / connection status component. Keep the best practice in mind: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Verify with: Browser DevTools Network tab WS filter + reconnection test with server restart. Output: diff, checklist.
- web-vitals-optimization-build: Write or modify code for "Web Vitals Optimisation (LCP/CLS/INP)". The typical output is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Keep the best practice in mind: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Verify with: Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Output: diff, checklist.
- adapter-smith: Call this when you need to move a skill to a different agent system, or to produce a cross-platform export of the entire catalog. Output: json, command.
- api-contract-smith: Call this when integrating a new API, designing a service boundary, or refactoring an existing endpoint contract. Output: json, checklist.
- a-b-testing-framework-tune: Optimize "A/B Testing Framework". Target the failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise." or the typical verification command statsmodels sample size calculation + Bayesian A/B test + sequential testing. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- a11y-aria-patterns-tune: Optimize "Accessibility ARIA Patterns". Target the failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers." or the typical verification command axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- agent-tool-binding-tune: Optimize "Agent Tool Binding & Dispatch". Target the failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly." or the typical verification command agent trace log + tool invocation frequency analysis + token cost audit. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- analytics-metric-definition-tune: Optimize "Analytics Metric Definitions". Target the failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers." or the typical verification command dbt docs generate + dbt test --select tag:metrics + metric comparison script. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- adr-documentation-tune: Optimize "Architecture Decision Records". Target the failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done." or the typical verification command adr-tools list + adr-tools generate + decision log index page. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- aws-lambda-cold-start-tune: Optimize "AWS Lambda Cold Starts". Target the failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler." or the typical verification command AWS X-Ray trace + Lambda Insights + cold start dashboard. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- azure-bicep-tune: Optimize "Azure Bicep Infrastructure". Target the failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce." or the typical verification command az deployment group validate + az what-if + bicep build. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- browser-devtools-tune: Optimize "Browser DevTools & Debugging". Target the failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically." or the typical verification command Chrome DevTools performance recording + memory heap snapshot + network throttle. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- cli-tool-design-tune: Optimize "CLI Tool Design Patterns". Target the failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with." or the typical verification command echo $? after CLI run + stderr redirection test + --json output validation. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- cloud-cost-optimization-tune: Optimize "Cloud Cost Optimisation". Target the failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours." or the typical verification command cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- code-review-checklist-tune: Optimize "Code Review Checklist". Target the failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions." or the typical verification command git diff --stat + lint-staged + danger.js automated review + commitlint. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- convex-functions-tune: Optimize "Convex Functions & Mutations". Target the failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients." or the typical verification command npx convex dev + dashboard OCC conflict log + custom retry logic. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- cron-job-reliability-tune: Optimize "Cron Job & Scheduled Task Reliability". Target the failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time." or the typical verification command tail -f /var/log/cron + systemctl status cron + idempotency test script. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- css-layout-tune: Optimize "CSS Layout & Responsiveness". Target the failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable." or the typical verification command Lighthouse mobile emulation + browser DevTools responsive mode. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- csv-data-cleaning-tune: Optimize "CSV Data Cleaning Pipeline". Target the failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines." or the typical verification command python3 -c csv.DictReader + validation script + row count diff. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- database-migration-safety-tune: Optimize "Database Migration Safety". Target the failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users." or the typical verification command pg_locks monitoring during migration + batch backfill script + rollback test. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- data-warehouse-schema-tune: Optimize "Data Warehouse Schema Design". Target the failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries." or the typical verification command dbt run + dbt test + query profiling with warehouse-native tools. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- design-token-system-tune: Optimize "Design Token Systems". Target the failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file." or the typical verification command style-dictionary build + Storybook token viewer + token value comparison. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- docker-compose-networking-tune: Optimize "Docker Compose Networking". Target the failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name." or the typical verification command docker compose up --wait + docker network inspect + container logs. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- docker-multistage-tune: Optimize "Docker Multi-Stage Builds". Target the failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure." or the typical verification command docker build + docker scout + dive layer analysis. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- drizzle-schema-design-tune: Optimize "Drizzle Schema Design". Target the failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster." or the typical verification command drizzle-kit push + drizzle-kit studio + generated SQL audit. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- error-monitoring-setup-tune: Optimize "Error Monitoring & Alerting Setup". Target the failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains." or the typical verification command Sentry API error list + alert rule test + source map validation. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- fastapi-dependencies-tune: Optimize "FastAPI Dependency Injection". Target the failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection." or the typical verification command uvicorn --reload + /docs interactive test + dependency graph visualisation. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- feature-flags-tune: Optimize "Feature Flags & Gradual Rollouts". Target the failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags." or the typical verification command flag evaluation log + rollout percentage monitoring + unused flag scan. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- git-conflict-resolution-tune: Optimize "Git Conflict Resolution". Target the failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs." or the typical verification command git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- github-actions-pipeline-tune: Optimize "GitHub Actions Pipeline Optimisation". Target the failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope." or the typical verification command act --job test + cache hit/miss analysis + workflow graph visualisation. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- graphql-n-plus-one-tune: Optimize "GraphQL N+1 Query Prevention". Target the failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children." or the typical verification command graphql query with tracing + DataLoader statistics + SQL log analysis. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- jest-test-optimization-tune: Optimize "Jest Test Optimisation". Target the failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes." or the typical verification command jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- json-schema-validation-tune: Optimize "JSON Schema Validation". Target the failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly." or the typical verification command ajv validate + JSON Schema test suite + response mock test. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- kubernetes-hpa-tune: Optimize "Kubernetes Horizontal Pod Autoscaling". Target the failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment." or the typical verification command kubectl get hpa --watch + kubectl top pods + metrics-server logs. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- kubernetes-pod-lifecycle-tune: Optimize "Kubernetes Pod Lifecycle". Target the failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready." or the typical verification command kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- context-window-budget-tune: Optimise "LLM Context Window Budget Management". Target the failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness." or the typical verification command tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, command.
- mcp-tool-design-tune: Optimize "MCP Tool Design & Best Practices". Target the failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent." or the typical verification command mcp-cli run + mcp inspector + tool name conflict analysis. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- message-queues-tune: Optimize "Message Queues & Background Jobs". Target the failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled." or the typical verification command Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- multi-tenant-isolation-tune: Optimize "Multi-Tenant Data Isolation". Target the failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data." or the typical verification command RLS policy test with two different tenant sessions + data leakage check. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- nextjs-api-routes-tune: Optimize "Next.js API Routes & Route Handlers". Target the failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component." or the typical verification command curl --verbose + API route error log + status code audit. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- nextjs-data-fetching-tune: Optimize "Next.js Data Fetching Patterns". Target the failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests." or the typical verification command next build --debug + React DevTools fetch profiling. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- nextjs-middleware-tune: Optimize "Next.js Middleware & Edge Runtime". Target the failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes." or the typical verification command next dev + curl --cookie tests + edge runtime log inspection. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- node-error-handling-tune: Optimize "Node.js Error Handling & Resilience". Target the failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context." or the typical verification command node --unhandled-rejections=strict + process.on('uncaughtException') log. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- node-streams-tune: Optimize "Node.js Streams & Backpressure". Target the failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams." or the typical verification command Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- oauth-flows-tune: Optimize "OAuth 2.0 Flows & Token Management". Target the failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation." or the typical verification command oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- openapi-spec-tune: Optimize "OpenAPI Specification & Validation". Target the failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code." or the typical verification command redocly lint + openapi-diff + swagger-ui preview. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- playwright-selectors-tune: Optimize "Playwright Selectors & Locators". Target the failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update." or the typical verification command playwright test --reporter=html + playwright codegen + trace viewer. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- prompt-injection-defense-tune: Optimize "Prompt Injection Defense". Target the failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'." or the typical verification command prompt injection test suite + adversarial input fuzzing + output scanner. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- python-async-tune: Optimize "Python Async/Await Patterns". Target the failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions." or the typical verification command python3 -m asyncio + aiohttp/httpx async benchmark. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- python-file-io-tune: Optimize "Python File I/O & Encoding". Target the failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content." or the typical verification command python3 -c with open() + chardet encoding detection. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- rag-chunking-tune: Optimize "RAG Chunking Strategies". Target the failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality." or the typical verification command retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- rate-limiting-proxy-tune: Optimize "Rate Limiting & API Gateway Proxy". Target the failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources." or the typical verification command ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- react-server-components-tune: Optimize "React Server Components". Target the failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file." or the typical verification command next build --debug + React Server Components lint rule. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- react-state-tune: Optimize "React State Management". Target the failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation." or the typical verification command React DevTools profiler + why-did-you-render. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- redis-caching-tune: Optimize "Redis Caching Strategies". Target the failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time." or the typical verification command redis-cli --stat + cache hit ratio monitoring + slow log. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- rest-pagination-tune: Optimize "REST Pagination Design". Target the failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows." or the typical verification command curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- secrets-rotation-tune: Optimize "Secrets Rotation Policy". Target the failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak." or the typical verification command vault lease list + secret expiry check + rotation dry-run test. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- shell-script-robustness-tune: Optimize "Shell Script Robustness & Safety". Target the failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage." or the typical verification command shellcheck script.sh + bash -n script.sh + dry-run mode test. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- sql-query-optimization-tune: Optimize "SQL Query Optimisation". Target the failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs." or the typical verification command EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- stealth-web-research-tune: Optimize "Stealth Web Research & Harvesting". Target the failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests." or the typical verification command playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- stripe-webhook-idempotency-tune: Optimize "Stripe Webhook Idempotency". Target the failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations." or the typical verification command stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- supabase-rls-tune: Optimize "Supabase Row-Level Security". Target the failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data." or the typical verification command supabase db check + supabase db test + RLS policy review with pg_policies. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- terraform-state-tune: Optimize "Terraform State Management". Target the failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure." or the typical verification command terraform plan + terraform state list + terraform state pull | jq. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- typescript-generics-tune: Optimize "TypeScript Generics & Advanced Types". Target the failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)." or the typical verification command tsc --noEmit --strict + type tests with expect-type. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- user-onboarding-flow-tune: Optimize "User Onboarding Flow Design". Target the failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value." or the typical verification command analytics funnel analysis + onboarding completion rate + drop-off heatmap. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- vercel-env-vars-tune: Optimize "Vercel Environment Variables". Target the failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments." or the typical verification command vercel env pull + vercel list + project settings audit. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- web-scraping-ethics-tune: Optimize "Web Scraping Ethics & Compliance". Target the failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues." or the typical verification command curl robots.txt + wget --wait + scraper log audit. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- websocket-reconnection-tune: Optimize "WebSocket Reconnection Strategies". Target the failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state." or the typical verification command Browser DevTools Network tab WS filter + reconnection test with server restart. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- web-vitals-optimization-tune: Optimize "Web Vitals Optimisation (LCP/CLS/INP)". Target the failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)." or the typical verification command Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Benchmark before and after. Prefer non-breaking optimisations. Output: markdown, json, checklist.
- intent-router: Call this when a user request is vague, multi-layered, or when you are unsure which specialised skill applies. Output: json, checklist.
- a-b-testing-framework-plan: A change to "A/B Testing Framework" needs to be designed first. Consider the common failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise." and the best practice "Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.". Produce a plan before writing any code. Output: markdown, json, checklist.
- a11y-aria-patterns-plan: A change to "Accessibility ARIA Patterns" needs to be designed first. Consider the common failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers." and the best practice "Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.". Produce a plan before writing any code. Output: markdown, json, checklist.
- agent-tool-binding-plan: A change to "Agent Tool Binding & Dispatch" needs to be designed first. Consider the common failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly." and the best practice "Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.". Produce a plan before writing any code. Output: markdown, json, checklist.
- analytics-metric-definition-plan: A change to "Analytics Metric Definitions" needs to be designed first. Consider the common failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers." and the best practice "Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.". Produce a plan before writing any code. Output: markdown, json, checklist.
- adr-documentation-plan: A change to "Architecture Decision Records" needs to be designed first. Consider the common failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done." and the best practice "Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.". Produce a plan before writing any code. Output: markdown, json, checklist.
- aws-lambda-cold-start-plan: A change to "AWS Lambda Cold Starts" needs to be designed first. Consider the common failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler." and the best practice "Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.". Produce a plan before writing any code. Output: markdown, json, checklist.
- azure-bicep-plan: A change to "Azure Bicep Infrastructure" needs to be designed first. Consider the common failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce." and the best practice "Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.". Produce a plan before writing any code. Output: markdown, json, checklist.
- browser-devtools-plan: A change to "Browser DevTools & Debugging" needs to be designed first. Consider the common failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically." and the best practice "Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.". Produce a plan before writing any code. Output: markdown, json, checklist.
- cli-tool-design-plan: A change to "CLI Tool Design Patterns" needs to be designed first. Consider the common failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with." and the best practice "Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.". Produce a plan before writing any code. Output: markdown, json, checklist.
- cloud-cost-optimization-plan: A change to "Cloud Cost Optimisation" needs to be designed first. Consider the common failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours." and the best practice "Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.". Produce a plan before writing any code. Output: markdown, json, checklist.
- code-review-checklist-plan: A change to "Code Review Checklist" needs to be designed first. Consider the common failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions." and the best practice "Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.". Produce a plan before writing any code. Output: markdown, json, checklist.
- convex-functions-plan: A change to "Convex Functions & Mutations" needs to be designed first. Consider the common failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients." and the best practice "Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.". Produce a plan before writing any code. Output: markdown, json, checklist.
- cron-job-reliability-plan: A change to "Cron Job & Scheduled Task Reliability" needs to be designed first. Consider the common failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time." and the best practice "Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.". Produce a plan before writing any code. Output: markdown, json, checklist.
- css-layout-plan: A change to "CSS Layout & Responsiveness" needs to be designed first. Consider the common failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable." and the best practice "Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.". Produce a plan before writing any code. Output: markdown, json, checklist.
- csv-data-cleaning-plan: A change to "CSV Data Cleaning Pipeline" needs to be designed first. Consider the common failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines." and the best practice "Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.". Produce a plan before writing any code. Output: markdown, json, checklist.
- database-migration-safety-plan: A change to "Database Migration Safety" needs to be designed first. Consider the common failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users." and the best practice "Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.". Produce a plan before writing any code. Output: markdown, json, checklist.
- data-warehouse-schema-plan: A change to "Data Warehouse Schema Design" needs to be designed first. Consider the common failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries." and the best practice "Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.". Produce a plan before writing any code. Output: markdown, json, checklist.
- design-token-system-plan: A change to "Design Token Systems" needs to be designed first. Consider the common failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file." and the best practice "Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.". Produce a plan before writing any code. Output: markdown, json, checklist.
- docker-compose-networking-plan: A change to "Docker Compose Networking" needs to be designed first. Consider the common failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name." and the best practice "All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.". Produce a plan before writing any code. Output: markdown, json, checklist.
- docker-multistage-plan: A change to "Docker Multi-Stage Builds" needs to be designed first. Consider the common failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure." and the best practice "Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.". Produce a plan before writing any code. Output: markdown, json, checklist.
- drizzle-schema-design-plan: A change to "Drizzle Schema Design" needs to be designed first. Consider the common failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster." and the best practice "Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.". Produce a plan before writing any code. Output: markdown, json, checklist.
- error-monitoring-setup-plan: A change to "Error Monitoring & Alerting Setup" needs to be designed first. Consider the common failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains." and the best practice "Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).". Produce a plan before writing any code. Output: markdown, json, checklist.
- fastapi-dependencies-plan: A change to "FastAPI Dependency Injection" needs to be designed first. Consider the common failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection." and the best practice "Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().". Produce a plan before writing any code. Output: markdown, json, checklist.
- feature-flags-plan: A change to "Feature Flags & Gradual Rollouts" needs to be designed first. Consider the common failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags." and the best practice "Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.". Produce a plan before writing any code. Output: markdown, json, checklist.
- git-conflict-resolution-plan: A change to "Git Conflict Resolution" needs to be designed first. Consider the common failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs." and the best practice "For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.". Produce a plan before writing any code. Output: markdown, json, checklist.
- github-actions-pipeline-plan: A change to "GitHub Actions Pipeline Optimisation" needs to be designed first. Consider the common failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope." and the best practice "Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.". Produce a plan before writing any code. Output: markdown, json, checklist.
- graphql-n-plus-one-plan: A change to "GraphQL N+1 Query Prevention" needs to be designed first. Consider the common failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children." and the best practice "Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.". Produce a plan before writing any code. Output: markdown, json, checklist.
- jest-test-optimization-plan: A change to "Jest Test Optimisation" needs to be designed first. Consider the common failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes." and the best practice "Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.". Produce a plan before writing any code. Output: markdown, json, checklist.
- json-schema-validation-plan: A change to "JSON Schema Validation" needs to be designed first. Consider the common failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly." and the best practice "Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.". Produce a plan before writing any code. Output: markdown, json, checklist.
- kubernetes-hpa-plan: A change to "Kubernetes Horizontal Pod Autoscaling" needs to be designed first. Consider the common failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment." and the best practice "Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.". Produce a plan before writing any code. Output: markdown, json, checklist.
- kubernetes-pod-lifecycle-plan: A change to "Kubernetes Pod Lifecycle" needs to be designed first. Consider the common failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready." and the best practice "Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.". Produce a plan before writing any code. Output: markdown, json, checklist.
- context-window-budget-plan: A change to "LLM Context Window Budget Management" needs to be designed first. Consider the common failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness." and the best practice "Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.". Produce a plan before writing any code. Output: markdown, json, checklist.
- mcp-tool-design-plan: A change to "MCP Tool Design & Best Practices" needs to be designed first. Consider the common failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent." and the best practice "Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.". Produce a plan before writing any code. Output: markdown, json, checklist.
- message-queues-plan: A change to "Message Queues & Background Jobs" needs to be designed first. Consider the common failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled." and the best practice "Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.". Produce a plan before writing any code. Output: markdown, json, checklist.
- multi-tenant-isolation-plan: A change to "Multi-Tenant Data Isolation" needs to be designed first. Consider the common failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data." and the best practice "Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.". Produce a plan before writing any code. Output: markdown, json, checklist.
- nextjs-api-routes-plan: A change to "Next.js API Routes & Route Handlers" needs to be designed first. Consider the common failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component." and the best practice "All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.". Produce a plan before writing any code. Output: markdown, json, checklist.
- nextjs-data-fetching-plan: A change to "Next.js Data Fetching Patterns" needs to be designed first. Consider the common failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests." and the best practice "Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.". Produce a plan before writing any code. Output: markdown, json, checklist.
- nextjs-middleware-plan: A change to "Next.js Middleware & Edge Runtime" needs to be designed first. Consider the common failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes." and the best practice "Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.". Produce a plan before writing any code. Output: markdown, json, checklist.
- node-error-handling-plan: A change to "Node.js Error Handling & Resilience" needs to be designed first. Consider the common failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context." and the best practice "Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.". Produce a plan before writing any code. Output: markdown, json, checklist.
- node-streams-plan: A change to "Node.js Streams & Backpressure" needs to be designed first. Consider the common failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams." and the best practice "Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.". Produce a plan before writing any code. Output: markdown, json, checklist.
- oauth-flows-plan: A change to "OAuth 2.0 Flows & Token Management" needs to be designed first. Consider the common failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation." and the best practice "Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.". Produce a plan before writing any code. Output: markdown, json, checklist.
- openapi-spec-plan: A change to "OpenAPI Specification & Validation" needs to be designed first. Consider the common failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code." and the best practice "Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.". Produce a plan before writing any code. Output: markdown, json, checklist.
- playwright-selectors-plan: A change to "Playwright Selectors & Locators" needs to be designed first. Consider the common failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update." and the best practice "Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.". Produce a plan before writing any code. Output: markdown, json, checklist.
- prompt-injection-defense-plan: A change to "Prompt Injection Defense" needs to be designed first. Consider the common failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'." and the best practice "Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.". Produce a plan before writing any code. Output: markdown, json, checklist.
- python-async-plan: A change to "Python Async/Await Patterns" needs to be designed first. Consider the common failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions." and the best practice "Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.". Produce a plan before writing any code. Output: markdown, json, checklist.
- python-file-io-plan: A change to "Python File I/O & Encoding" needs to be designed first. Consider the common failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content." and the best practice "Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.". Produce a plan before writing any code. Output: markdown, json, checklist.
- rag-chunking-plan: A change to "RAG Chunking Strategies" needs to be designed first. Consider the common failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality." and the best practice "Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.". Produce a plan before writing any code. Output: markdown, json, checklist.
- rate-limiting-proxy-plan: A change to "Rate Limiting & API Gateway Proxy" needs to be designed first. Consider the common failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources." and the best practice "Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.". Produce a plan before writing any code. Output: markdown, json, checklist.
- react-server-components-plan: A change to "React Server Components" needs to be designed first. Consider the common failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file." and the best practice "Keep data fetching and heavy logic in server components; pass results as props to client islands.". Produce a plan before writing any code. Output: markdown, json, checklist.
- react-state-plan: A change to "React State Management" needs to be designed first. Consider the common failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation." and the best practice "Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.". Produce a plan before writing any code. Output: markdown, json, checklist.
- reasoning-architect: Call this when a task spans multiple systems, is vaguely defined, or carries risk of cascading failures. Output: markdown, checklist.
- redis-caching-plan: A change to "Redis Caching Strategies" needs to be designed first. Consider the common failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time." and the best practice "Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.". Produce a plan before writing any code. Output: markdown, json, checklist.
- rest-pagination-plan: A change to "REST Pagination Design" needs to be designed first. Consider the common failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows." and the best practice "Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.". Produce a plan before writing any code. Output: markdown, json, checklist.
- secrets-rotation-plan: A change to "Secrets Rotation Policy" needs to be designed first. Consider the common failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak." and the best practice "Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.". Produce a plan before writing any code. Output: markdown, json, checklist.
- shell-script-robustness-plan: A change to "Shell Script Robustness & Safety" needs to be designed first. Consider the common failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage." and the best practice "Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.". Produce a plan before writing any code. Output: markdown, json, checklist.
- sql-query-optimization-plan: A change to "SQL Query Optimisation" needs to be designed first. Consider the common failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs." and the best practice "Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.". Produce a plan before writing any code. Output: markdown, json, checklist.
- stealth-web-research-plan: A change to "Stealth Web Research & Harvesting" needs to be designed first. Consider the common failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests." and the best practice "Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.". Produce a plan before writing any code. Output: markdown, json, checklist.
- stripe-webhook-idempotency-plan: A change to "Stripe Webhook Idempotency" needs to be designed first. Consider the common failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations." and the best practice "Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.". Produce a plan before writing any code. Output: markdown, json, checklist.
- supabase-rls-plan: A change to "Supabase Row-Level Security" needs to be designed first. Consider the common failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data." and the best practice "Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.". Produce a plan before writing any code. Output: markdown, json, checklist.
- terraform-state-plan: A change to "Terraform State Management" needs to be designed first. Consider the common failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure." and the best practice "Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.". Produce a plan before writing any code. Output: markdown, json, checklist.
- typescript-generics-plan: A change to "TypeScript Generics & Advanced Types" needs to be designed first. Consider the common failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)." and the best practice "Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.". Produce a plan before writing any code. Output: markdown, json, checklist.
- user-onboarding-flow-plan: A change to "User Onboarding Flow Design" needs to be designed first. Consider the common failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value." and the best practice "Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.". Produce a plan before writing any code. Output: markdown, json, checklist.
- vercel-env-vars-plan: A change to "Vercel Environment Variables" needs to be designed first. Consider the common failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments." and the best practice "Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.". Produce a plan before writing any code. Output: markdown, json, checklist.
- web-scraping-ethics-plan: A change to "Web Scraping Ethics & Compliance" needs to be designed first. Consider the common failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues." and the best practice "Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.". Produce a plan before writing any code. Output: markdown, json, checklist.
- websocket-reconnection-plan: A change to "WebSocket Reconnection Strategies" needs to be designed first. Consider the common failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state." and the best practice "Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.". Produce a plan before writing any code. Output: markdown, json, checklist.
- web-vitals-optimization-plan: A change to "Web Vitals Optimisation (LCP/CLS/INP)" needs to be designed first. Consider the common failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)." and the best practice "Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.". Produce a plan before writing any code. Output: markdown, json, checklist.
- incident-debugger: Call this when a build fails, a test fails, an API returns an unexpected status, or a runtime error occurs. Output: markdown, checklist.
- verification-runner: Call this after completing any code change to confirm nothing is broken. Output: command, checklist.
- a-b-testing-framework-harden: Audit and harden "A/B Testing Framework". The common failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise." may be present. Follow the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Produce a risk-ranked list of findings. Output: json, checklist.
- a11y-aria-patterns-harden: Audit and harden "Accessibility ARIA Patterns". The common failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers." may be present. Follow the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Produce a risk-ranked list of findings. Output: json, checklist.
- agent-tool-binding-harden: Audit and harden "Agent Tool Binding & Dispatch". The common failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly." may be present. Follow the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Produce a risk-ranked list of findings. Output: json, checklist.
- analytics-metric-definition-harden: Audit and harden "Analytics Metric Definitions". The common failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers." may be present. Follow the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Produce a risk-ranked list of findings. Output: json, checklist.
- adr-documentation-harden: Audit and harden "Architecture Decision Records". The common failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done." may be present. Follow the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Produce a risk-ranked list of findings. Output: json, checklist.
- aws-lambda-cold-start-harden: Audit and harden "AWS Lambda Cold Starts". The common failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler." may be present. Follow the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Produce a risk-ranked list of findings. Output: json, checklist.
- azure-bicep-harden: Audit and harden "Azure Bicep Infrastructure". The common failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce." may be present. Follow the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Produce a risk-ranked list of findings. Output: json, checklist.
- browser-devtools-harden: Audit and harden "Browser DevTools & Debugging". The common failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically." may be present. Follow the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Produce a risk-ranked list of findings. Output: json, checklist.
- cli-tool-design-harden: Audit and harden "CLI Tool Design Patterns". The common failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with." may be present. Follow the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Produce a risk-ranked list of findings. Output: json, checklist.
- cloud-cost-optimization-harden: Audit and harden "Cloud Cost Optimisation". The common failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours." may be present. Follow the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Produce a risk-ranked list of findings. Output: json, checklist.
- code-review-checklist-harden: Audit and harden "Code Review Checklist". The common failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions." may be present. Follow the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Produce a risk-ranked list of findings. Output: json, checklist.
- convex-functions-harden: Audit and harden "Convex Functions & Mutations". The common failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients." may be present. Follow the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Produce a risk-ranked list of findings. Output: json, checklist.
- cron-job-reliability-harden: Audit and harden "Cron Job & Scheduled Task Reliability". The common failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time." may be present. Follow the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Produce a risk-ranked list of findings. Output: json, checklist.
- css-layout-harden: Audit and harden "CSS Layout & Responsiveness". The common failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable." may be present. Follow the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Produce a risk-ranked list of findings. Output: json, checklist.
- csv-data-cleaning-harden: Audit and harden "CSV Data Cleaning Pipeline". The common failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines." may be present. Follow the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Produce a risk-ranked list of findings. Output: json, checklist.
- database-migration-safety-harden: Audit and harden "Database Migration Safety". The common failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users." may be present. Follow the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Produce a risk-ranked list of findings. Output: json, checklist.
- data-warehouse-schema-harden: Audit and harden "Data Warehouse Schema Design". The common failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries." may be present. Follow the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Produce a risk-ranked list of findings. Output: json, checklist.
- design-token-system-harden: Audit and harden "Design Token Systems". The common failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file." may be present. Follow the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Produce a risk-ranked list of findings. Output: json, checklist.
- docker-compose-networking-harden: Audit and harden "Docker Compose Networking". The common failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name." may be present. Follow the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Produce a risk-ranked list of findings. Output: json, checklist.
- docker-multistage-harden: Audit and harden "Docker Multi-Stage Builds". The common failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure." may be present. Follow the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Produce a risk-ranked list of findings. Output: json, checklist.
- drizzle-schema-design-harden: Audit and harden "Drizzle Schema Design". The common failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster." may be present. Follow the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Produce a risk-ranked list of findings. Output: json, checklist.
- error-monitoring-setup-harden: Audit and harden "Error Monitoring & Alerting Setup". The common failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains." may be present. Follow the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Produce a risk-ranked list of findings. Output: json, checklist.
- fastapi-dependencies-harden: Audit and harden "FastAPI Dependency Injection". The common failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection." may be present. Follow the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Produce a risk-ranked list of findings. Output: json, checklist.
- feature-flags-harden: Audit and harden "Feature Flags & Gradual Rollouts". The common failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags." may be present. Follow the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Produce a risk-ranked list of findings. Output: json, checklist.
- git-conflict-resolution-harden: Audit and harden "Git Conflict Resolution". The common failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs." may be present. Follow the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Produce a risk-ranked list of findings. Output: json, checklist.
- github-actions-pipeline-harden: Audit and harden "GitHub Actions Pipeline Optimisation". The common failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope." may be present. Follow the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Produce a risk-ranked list of findings. Output: json, checklist.
- graphql-n-plus-one-harden: Audit and harden "GraphQL N+1 Query Prevention". The common failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children." may be present. Follow the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Produce a risk-ranked list of findings. Output: json, checklist.
- jest-test-optimization-harden: Audit and harden "Jest Test Optimisation". The common failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes." may be present. Follow the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Produce a risk-ranked list of findings. Output: json, checklist.
- json-schema-validation-harden: Audit and harden "JSON Schema Validation". The common failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly." may be present. Follow the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Produce a risk-ranked list of findings. Output: json, checklist.
- kubernetes-hpa-harden: Audit and harden "Kubernetes Horizontal Pod Autoscaling". The common failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment." may be present. Follow the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Produce a risk-ranked list of findings. Output: json, checklist.
- kubernetes-pod-lifecycle-harden: Audit and harden "Kubernetes Pod Lifecycle". The common failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready." may be present. Follow the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Produce a risk-ranked list of findings. Output: json, checklist.
- context-window-budget-harden: Audit and harden "LLM Context Window Budget Management". The common failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness." may be present. Follow the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Produce a risk-ranked list of findings. Output: markdown, checklist.
- mcp-tool-design-harden: Audit and harden "MCP Tool Design & Best Practices". The common failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent." may be present. Follow the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Produce a risk-ranked list of findings. Output: json, checklist.
- message-queues-harden: Audit and harden "Message Queues & Background Jobs". The common failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled." may be present. Follow the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Produce a risk-ranked list of findings. Output: json, checklist.
- multi-tenant-isolation-harden: Audit and harden "Multi-Tenant Data Isolation". The common failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data." may be present. Follow the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Produce a risk-ranked list of findings. Output: json, checklist.
- nextjs-api-routes-harden: Audit and harden "Next.js API Routes & Route Handlers". The common failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component." may be present. Follow the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Produce a risk-ranked list of findings. Output: json, checklist.
- nextjs-data-fetching-harden: Audit and harden "Next.js Data Fetching Patterns". The common failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests." may be present. Follow the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Produce a risk-ranked list of findings. Output: json, checklist.
- nextjs-middleware-harden: Audit and harden "Next.js Middleware & Edge Runtime". The common failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes." may be present. Follow the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Produce a risk-ranked list of findings. Output: json, checklist.
- node-error-handling-harden: Audit and harden "Node.js Error Handling & Resilience". The common failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context." may be present. Follow the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Produce a risk-ranked list of findings. Output: json, checklist.
- node-streams-harden: Audit and harden "Node.js Streams & Backpressure". The common failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams." may be present. Follow the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Produce a risk-ranked list of findings. Output: json, checklist.
- oauth-flows-harden: Audit and harden "OAuth 2.0 Flows & Token Management". The common failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation." may be present. Follow the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Produce a risk-ranked list of findings. Output: json, checklist.
- openapi-spec-harden: Audit and harden "OpenAPI Specification & Validation". The common failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code." may be present. Follow the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Produce a risk-ranked list of findings. Output: json, checklist.
- playwright-selectors-harden: Audit and harden "Playwright Selectors & Locators". The common failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update." may be present. Follow the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Produce a risk-ranked list of findings. Output: json, checklist.
- prompt-injection-defense-harden: Audit and harden "Prompt Injection Defense". The common failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'." may be present. Follow the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Produce a risk-ranked list of findings. Output: json, checklist.
- python-async-harden: Audit and harden "Python Async/Await Patterns". The common failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions." may be present. Follow the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Produce a risk-ranked list of findings. Output: json, checklist.
- python-file-io-harden: Audit and harden "Python File I/O & Encoding". The common failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content." may be present. Follow the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Produce a risk-ranked list of findings. Output: json, checklist.
- rag-chunking-harden: Audit and harden "RAG Chunking Strategies". The common failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality." may be present. Follow the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Produce a risk-ranked list of findings. Output: json, checklist.
- rate-limiting-proxy-harden: Audit and harden "Rate Limiting & API Gateway Proxy". The common failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources." may be present. Follow the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Produce a risk-ranked list of findings. Output: json, checklist.
- react-server-components-harden: Audit and harden "React Server Components". The common failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file." may be present. Follow the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Produce a risk-ranked list of findings. Output: json, checklist.
- react-state-harden: Audit and harden "React State Management". The common failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation." may be present. Follow the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Produce a risk-ranked list of findings. Output: json, checklist.
- redis-caching-harden: Audit and harden "Redis Caching Strategies". The common failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time." may be present. Follow the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Produce a risk-ranked list of findings. Output: json, checklist.
- rest-pagination-harden: Audit and harden "REST Pagination Design". The common failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows." may be present. Follow the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Produce a risk-ranked list of findings. Output: json, checklist.
- secrets-rotation-harden: Audit and harden "Secrets Rotation Policy". The common failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak." may be present. Follow the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Produce a risk-ranked list of findings. Output: json, checklist.
- shell-script-robustness-harden: Audit and harden "Shell Script Robustness & Safety". The common failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage." may be present. Follow the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Produce a risk-ranked list of findings. Output: json, checklist.
- sql-query-optimization-harden: Audit and harden "SQL Query Optimisation". The common failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs." may be present. Follow the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Produce a risk-ranked list of findings. Output: json, checklist.
- stealth-web-research-harden: Audit and harden "Stealth Web Research & Harvesting". The common failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests." may be present. Follow the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Produce a risk-ranked list of findings. Output: json, checklist.
- stripe-webhook-idempotency-harden: Audit and harden "Stripe Webhook Idempotency". The common failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations." may be present. Follow the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Produce a risk-ranked list of findings. Output: json, checklist.
- supabase-rls-harden: Audit and harden "Supabase Row-Level Security". The common failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data." may be present. Follow the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Produce a risk-ranked list of findings. Output: json, checklist.
- terraform-state-harden: Audit and harden "Terraform State Management". The common failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure." may be present. Follow the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Produce a risk-ranked list of findings. Output: json, checklist.
- typescript-generics-harden: Audit and harden "TypeScript Generics & Advanced Types". The common failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)." may be present. Follow the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Produce a risk-ranked list of findings. Output: json, checklist.
- user-onboarding-flow-harden: Audit and harden "User Onboarding Flow Design". The common failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value." may be present. Follow the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Produce a risk-ranked list of findings. Output: json, checklist.
- vercel-env-vars-harden: Audit and harden "Vercel Environment Variables". The common failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments." may be present. Follow the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Produce a risk-ranked list of findings. Output: json, checklist.
- web-scraping-ethics-harden: Audit and harden "Web Scraping Ethics & Compliance". The common failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues." may be present. Follow the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Produce a risk-ranked list of findings. Output: json, checklist.
- websocket-reconnection-harden: Audit and harden "WebSocket Reconnection Strategies". The common failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state." may be present. Follow the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Produce a risk-ranked list of findings. Output: json, checklist.
- web-vitals-optimization-harden: Audit and harden "Web Vitals Optimisation (LCP/CLS/INP)". The common failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)." may be present. Follow the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Produce a risk-ranked list of findings. Output: json, checklist.

## General safety
- Never write secret values into the client bundle.
- Never consider a code change done without running its verification commands.
- Fall back to generic markdown + JSON manifest behavior if the target runtime is unknown.
__USB_CURSOR_RULE_90E7CDAC35836F28__

write_file "$PACK_DIR/skills/a-b-testing-framework-audit.md" <<'__USB_SKILL_0BCC9A9DA32A51EA__'
---
description: "[A/B Testing Framework] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets experiment spec / variant assignment / metric definition / statistical analysis script."
slug: a-b-testing-framework-audit
name: A/B Testing Framework: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:a-b-testing-framework, workflow:audit, audit, ab-testing, experiments, product
---

# A/B Testing Framework: Audit

[A/B Testing Framework] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..

## When to use it
You need to examine the current "A/B Testing Framework" setup without making changes. Look for the specific failure pattern: "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing A/B Testing Framework. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Use the best practice Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle. as your evaluation baseline. Verify your findings with statsmodels sample size calculation + Bayesian A/B test + sequential testing. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current A/B Testing Framework setup" — produce an inventory of experiment spec / variant assignment / metric definition / statistical analysis script and flag issues related to Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.
- "Check A/B Testing Framework health" — run statsmodels sample size calculation and summarise findings.
__USB_SKILL_0BCC9A9DA32A51EA__

write_file "$PACK_DIR/skills/a11y-aria-patterns-audit.md" <<'__USB_SKILL_D177D1DD255C98C6__'
---
description: "[Accessibility ARIA Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script."
slug: a11y-aria-patterns-audit
name: Accessibility ARIA Patterns: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:a11y-aria-patterns, workflow:audit, audit, accessibility, aria, testing
---

# Accessibility ARIA Patterns: Audit

[Accessibility ARIA Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..

## When to use it
You need to examine the current "Accessibility ARIA Patterns" setup without making changes. Look for the specific failure pattern: "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Accessibility ARIA Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Use the best practice Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader. as your evaluation baseline. Verify your findings with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Accessibility ARIA Patterns setup" — produce an inventory of ARIA attribute refactor / keyboard navigation / focus management / screen reader test script and flag issues related to Adding ARIA attributes that conflict with native HTML semantics (e.
- "Check Accessibility ARIA Patterns health" — run axe-core and summarise findings.
__USB_SKILL_D177D1DD255C98C6__

write_file "$PACK_DIR/skills/agent-tool-binding-audit.md" <<'__USB_SKILL_1DEE52FB238C116E__'
---
description: "[Agent Tool Binding & Dispatch] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets router tool / domain group / dynamic tool injection / tool usage statistics."
slug: agent-tool-binding-audit
name: Agent Tool Binding & Dispatch: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:agent-tool-binding, workflow:audit, audit, agents, tool-binding, orchestration
---

# Agent Tool Binding & Dispatch: Audit

[Agent Tool Binding & Dispatch] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..

## When to use it
You need to examine the current "Agent Tool Binding & Dispatch" setup without making changes. Look for the specific failure pattern: "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Agent Tool Binding & Dispatch. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Use the best practice Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step. as your evaluation baseline. Verify your findings with agent trace log + tool invocation frequency analysis + token cost audit. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Agent Tool Binding & Dispatch setup" — produce an inventory of router tool / domain group / dynamic tool injection / tool usage statistics and flag issues related to Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.
- "Check Agent Tool Binding & Dispatch health" — run agent trace log and summarise findings.
__USB_SKILL_1DEE52FB238C116E__

write_file "$PACK_DIR/skills/analytics-metric-definition-audit.md" <<'__USB_SKILL_94CE9E7B95BF38DF__'
---
description: "[Analytics Metric Definitions] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation."
slug: analytics-metric-definition-audit
name: Analytics Metric Definitions: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:analytics-metric-definition, workflow:audit, audit, analytics, metrics, data
---

# Analytics Metric Definitions: Audit

[Analytics Metric Definitions] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..

## When to use it
You need to examine the current "Analytics Metric Definitions" setup without making changes. Look for the specific failure pattern: "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Analytics Metric Definitions. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Use the best practice Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly. as your evaluation baseline. Verify your findings with dbt docs generate + dbt test --select tag:metrics + metric comparison script. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Analytics Metric Definitions setup" — produce an inventory of metric definition / dbt model / SQL logic / dashboard tile / documentation and flag issues related to Different teams computing the same metric (e.
- "Check Analytics Metric Definitions health" — run dbt docs generate and summarise findings.
__USB_SKILL_94CE9E7B95BF38DF__

write_file "$PACK_DIR/skills/adr-documentation-audit.md" <<'__USB_SKILL_493791055C6DE326__'
---
description: "[Architecture Decision Records] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets ADR document / decision log / template / review workflow."
slug: adr-documentation-audit
name: Architecture Decision Records: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:adr-documentation, workflow:audit, audit, documentation, adr, architecture
---

# Architecture Decision Records: Audit

[Architecture Decision Records] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..

## When to use it
You need to examine the current "Architecture Decision Records" setup without making changes. Look for the specific failure pattern: "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Architecture Decision Records. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Use the best practice Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences. as your evaluation baseline. Verify your findings with adr-tools list + adr-tools generate + decision log index page. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ADR document / decision log / template / review workflow this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Architecture Decision Records setup" — produce an inventory of ADR document / decision log / template / review workflow and flag issues related to Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.
- "Check Architecture Decision Records health" — run adr-tools list and summarise findings.
__USB_SKILL_493791055C6DE326__

write_file "$PACK_DIR/skills/aws-lambda-cold-start-audit.md" <<'__USB_SKILL_140F49557E1169AF__'
---
description: "[AWS Lambda Cold Starts] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function."
slug: aws-lambda-cold-start-audit
name: AWS Lambda Cold Starts: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:aws-lambda-cold-start, workflow:audit, audit, aws, lambda, performance
---

# AWS Lambda Cold Starts: Audit

[AWS Lambda Cold Starts] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..

## When to use it
You need to examine the current "AWS Lambda Cold Starts" setup without making changes. Look for the specific failure pattern: "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing AWS Lambda Cold Starts. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Use the best practice Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions. as your evaluation baseline. Verify your findings with AWS X-Ray trace + Lambda Insights + cold start dashboard. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current AWS Lambda Cold Starts setup" — produce an inventory of handler refactor / SnapStart config / Provisioned Concurrency / warmer function and flag issues related to Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.
- "Check AWS Lambda Cold Starts health" — run AWS X-Ray trace and summarise findings.
__USB_SKILL_140F49557E1169AF__

write_file "$PACK_DIR/skills/azure-bicep-audit.md" <<'__USB_SKILL_9F7AAA3A3829C8E1__'
---
description: "[Azure Bicep Infrastructure] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets main.bicep / module / parameter file / azd template."
slug: azure-bicep-audit
name: Azure Bicep Infrastructure: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:azure-bicep, workflow:audit, audit, azure, bicep, iac
---

# Azure Bicep Infrastructure: Audit

[Azure Bicep Infrastructure] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..

## When to use it
You need to examine the current "Azure Bicep Infrastructure" setup without making changes. Look for the specific failure pattern: "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Azure Bicep Infrastructure. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Use the best practice Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic. as your evaluation baseline. Verify your findings with az deployment group validate + az what-if + bicep build. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific main.bicep / module / parameter file / azd template this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Azure Bicep Infrastructure setup" — produce an inventory of main.bicep / module / parameter file / azd template and flag issues related to Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.
- "Check Azure Bicep Infrastructure health" — run az deployment group validate and summarise findings.
__USB_SKILL_9F7AAA3A3829C8E1__

write_file "$PACK_DIR/skills/browser-devtools-audit.md" <<'__USB_SKILL_5A6F6D2596BAD6EC__'
---
description: "[Browser DevTools & Debugging] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot."
slug: browser-devtools-audit
name: Browser DevTools & Debugging: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:browser-devtools, workflow:audit, audit, browser, debugging, devtools
---

# Browser DevTools & Debugging: Audit

[Browser DevTools & Debugging] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..

## When to use it
You need to examine the current "Browser DevTools & Debugging" setup without making changes. Look for the specific failure pattern: "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Browser DevTools & Debugging. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Use the best practice Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM. as your evaluation baseline. Verify your findings with Chrome DevTools performance recording + memory heap snapshot + network throttle. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Browser DevTools & Debugging setup" — produce an inventory of debugging workflow / breakpoint guide / performance recording / memory snapshot and flag issues related to Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.
- "Check Browser DevTools & Debugging health" — run Chrome DevTools performance recording and summarise findings.
__USB_SKILL_5A6F6D2596BAD6EC__

write_file "$PACK_DIR/skills/cli-tool-design-audit.md" <<'__USB_SKILL_386515D91C10471A__'
---
description: "[CLI Tool Design Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CLI scaffolding / argument parser / exit code handler / --json output mode."
slug: cli-tool-design-audit
name: CLI Tool Design Patterns: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:cli-tool-design, workflow:audit, audit, cli, devtools, scripting
---

# CLI Tool Design Patterns: Audit

[CLI Tool Design Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..

## When to use it
You need to examine the current "CLI Tool Design Patterns" setup without making changes. Look for the specific failure pattern: "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing CLI Tool Design Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Use the best practice Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output. as your evaluation baseline. Verify your findings with echo $? after CLI run + stderr redirection test + --json output validation. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current CLI Tool Design Patterns setup" — produce an inventory of CLI scaffolding / argument parser / exit code handler / --json output mode and flag issues related to Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.
- "Check CLI Tool Design Patterns health" — run echo $? after CLI run and summarise findings.
__USB_SKILL_386515D91C10471A__

write_file "$PACK_DIR/skills/cloud-cost-optimization-audit.md" <<'__USB_SKILL_11A961A284D43134__'
---
description: "[Cloud Cost Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report."
slug: cloud-cost-optimization-audit
name: Cloud Cost Optimisation: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:cloud-cost-optimization, workflow:audit, audit, cloud, cost, optimization
---

# Cloud Cost Optimisation: Audit

[Cloud Cost Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..

## When to use it
You need to examine the current "Cloud Cost Optimisation" setup without making changes. Look for the specific failure pattern: "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Cloud Cost Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Use the best practice Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments. as your evaluation baseline. Verify your findings with cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Cloud Cost Optimisation setup" — produce an inventory of right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report and flag issues related to Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.
- "Check Cloud Cost Optimisation health" — run cloud cost explorer and summarise findings.
__USB_SKILL_11A961A284D43134__

write_file "$PACK_DIR/skills/code-review-checklist-audit.md" <<'__USB_SKILL_1C121E015EDE357C__'
---
description: "[Code Review Checklist] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets review checklist / automated review comment / risk classification / diff summary."
slug: code-review-checklist-audit
name: Code Review Checklist: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:code-review-checklist, workflow:audit, audit, code-review, quality, checklist
---

# Code Review Checklist: Audit

[Code Review Checklist] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..

## When to use it
You need to examine the current "Code Review Checklist" setup without making changes. Look for the specific failure pattern: "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Code Review Checklist. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Use the best practice Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order. as your evaluation baseline. Verify your findings with git diff --stat + lint-staged + danger.js automated review + commitlint. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific review checklist / automated review comment / risk classification / diff summary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Code Review Checklist setup" — produce an inventory of review checklist / automated review comment / risk classification / diff summary and flag issues related to Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.
- "Check Code Review Checklist health" — run git diff --stat and summarise findings.
__USB_SKILL_1C121E015EDE357C__

write_file "$PACK_DIR/skills/convex-functions-audit.md" <<'__USB_SKILL_9B2DE93831F5CDA4__'
---
description: "[Convex Functions & Mutations] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets mutation / query / action / component / scheduler job."
slug: convex-functions-audit
name: Convex Functions & Mutations: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:convex-functions, workflow:audit, audit, convex, realtime, backend
---

# Convex Functions & Mutations: Audit

[Convex Functions & Mutations] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..

## When to use it
You need to examine the current "Convex Functions & Mutations" setup without making changes. Look for the specific failure pattern: "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Convex Functions & Mutations. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Use the best practice Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back. as your evaluation baseline. Verify your findings with npx convex dev + dashboard OCC conflict log + custom retry logic. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific mutation / query / action / component / scheduler job this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Convex Functions & Mutations setup" — produce an inventory of mutation / query / action / component / scheduler job and flag issues related to Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.
- "Check Convex Functions & Mutations health" — run npx convex dev and summarise findings.
__USB_SKILL_9B2DE93831F5CDA4__

write_file "$PACK_DIR/skills/cron-job-reliability-audit.md" <<'__USB_SKILL_0C93374649BCC991__'
---
description: "[Cron Job & Scheduled Task Reliability] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets crontab entry / log rotation / idempotency guard / failure alert integration."
slug: cron-job-reliability-audit
name: Cron Job & Scheduled Task Reliability: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:cron-job-reliability, workflow:audit, audit, cron, scheduling, reliability
---

# Cron Job & Scheduled Task Reliability: Audit

[Cron Job & Scheduled Task Reliability] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..

## When to use it
You need to examine the current "Cron Job & Scheduled Task Reliability" setup without making changes. Look for the specific failure pattern: "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Cron Job & Scheduled Task Reliability. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Use the best practice Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects. as your evaluation baseline. Verify your findings with tail -f /var/log/cron + systemctl status cron + idempotency test script. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Cron Job & Scheduled Task Reliability setup" — produce an inventory of crontab entry / log rotation / idempotency guard / failure alert integration and flag issues related to Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.
- "Check Cron Job & Scheduled Task Reliability health" — run tail -f /var/log/cron and summarise findings.
__USB_SKILL_0C93374649BCC991__

write_file "$PACK_DIR/skills/css-layout-audit.md" <<'__USB_SKILL_1020FAD0A2823FBE__'
---
description: "[CSS Layout & Responsiveness] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CSS layout refactor / responsive grid / container query implementation."
slug: css-layout-audit
name: CSS Layout & Responsiveness: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:css-layout, workflow:audit, audit, css, layout, frontend
---

# CSS Layout & Responsiveness: Audit

[CSS Layout & Responsiveness] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..

## When to use it
You need to examine the current "CSS Layout & Responsiveness" setup without making changes. Look for the specific failure pattern: "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing CSS Layout & Responsiveness. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Use the best practice Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints. as your evaluation baseline. Verify your findings with Lighthouse mobile emulation + browser DevTools responsive mode. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSS layout refactor / responsive grid / container query implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current CSS Layout & Responsiveness setup" — produce an inventory of CSS layout refactor / responsive grid / container query implementation and flag issues related to Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.
- "Check CSS Layout & Responsiveness health" — run Lighthouse mobile emulation and summarise findings.
__USB_SKILL_1020FAD0A2823FBE__

write_file "$PACK_DIR/skills/csv-data-cleaning-audit.md" <<'__USB_SKILL_4414229E4E7A1B27__'
---
description: "[CSV Data Cleaning Pipeline] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CSV parser / row validator / column type mapper / error report / cleaned output."
slug: csv-data-cleaning-audit
name: CSV Data Cleaning Pipeline: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:csv-data-cleaning, workflow:audit, audit, data, csv, pipeline
---

# CSV Data Cleaning Pipeline: Audit

[CSV Data Cleaning Pipeline] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..

## When to use it
You need to examine the current "CSV Data Cleaning Pipeline" setup without making changes. Look for the specific failure pattern: "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing CSV Data Cleaning Pipeline. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Use the best practice Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row. as your evaluation baseline. Verify your findings with python3 -c csv.DictReader + validation script + row count diff. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current CSV Data Cleaning Pipeline setup" — produce an inventory of CSV parser / row validator / column type mapper / error report / cleaned output and flag issues related to Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.
- "Check CSV Data Cleaning Pipeline health" — run python3 -c csv.DictReader and summarise findings.
__USB_SKILL_4414229E4E7A1B27__

write_file "$PACK_DIR/skills/database-migration-safety-audit.md" <<'__USB_SKILL_B62D35D6A7E80B6A__'
---
description: "[Database Migration Safety] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan."
slug: database-migration-safety-audit
name: Database Migration Safety: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:database-migration-safety, workflow:audit, audit, database, migration, safety
---

# Database Migration Safety: Audit

[Database Migration Safety] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..

## When to use it
You need to examine the current "Database Migration Safety" setup without making changes. Look for the specific failure pattern: "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Database Migration Safety. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Use the best practice Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default. as your evaluation baseline. Verify your findings with pg_locks monitoring during migration + batch backfill script + rollback test. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Database Migration Safety setup" — produce an inventory of batch migration / expand-contract pattern / zero-downtime migration / rollback plan and flag issues related to Running a long-running migration (e.
- "Check Database Migration Safety health" — run pg_locks monitoring during migration and summarise findings.
__USB_SKILL_B62D35D6A7E80B6A__

write_file "$PACK_DIR/skills/data-warehouse-schema-audit.md" <<'__USB_SKILL_26BE9E665F1F1CC1__'
---
description: "[Data Warehouse Schema Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets star schema / fact table / dimension table / ETL pipeline spec."
slug: data-warehouse-schema-audit
name: Data Warehouse Schema Design: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:data-warehouse-schema, workflow:audit, audit, data, warehouse, schema
---

# Data Warehouse Schema Design: Audit

[Data Warehouse Schema Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..

## When to use it
You need to examine the current "Data Warehouse Schema Design" setup without making changes. Look for the specific failure pattern: "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Data Warehouse Schema Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Use the best practice Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time. as your evaluation baseline. Verify your findings with dbt run + dbt test + query profiling with warehouse-native tools. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific star schema / fact table / dimension table / ETL pipeline spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Data Warehouse Schema Design setup" — produce an inventory of star schema / fact table / dimension table / ETL pipeline spec and flag issues related to Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.
- "Check Data Warehouse Schema Design health" — run dbt run and summarise findings.
__USB_SKILL_26BE9E665F1F1CC1__

write_file "$PACK_DIR/skills/design-token-system-audit.md" <<'__USB_SKILL_F8240CC94397D8B1__'
---
description: "[Design Token Systems] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets token JSON / CSS custom properties / theme switcher / token documentation."
slug: design-token-system-audit
name: Design Token Systems: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:design-token-system, workflow:audit, audit, design, tokens, components
---

# Design Token Systems: Audit

[Design Token Systems] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..

## When to use it
You need to examine the current "Design Token Systems" setup without making changes. Look for the specific failure pattern: "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Design Token Systems. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Use the best practice Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values. as your evaluation baseline. Verify your findings with style-dictionary build + Storybook token viewer + token value comparison. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Design Token Systems setup" — produce an inventory of token JSON / CSS custom properties / theme switcher / token documentation and flag issues related to Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.
- "Check Design Token Systems health" — run style-dictionary build and summarise findings.
__USB_SKILL_F8240CC94397D8B1__

write_file "$PACK_DIR/skills/docker-compose-networking-audit.md" <<'__USB_SKILL_54962B6DBD19F443__'
---
description: "[Docker Compose Networking] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets docker-compose.yml / network config / healthcheck / depends_on condition."
slug: docker-compose-networking-audit
name: Docker Compose Networking: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:docker-compose-networking, workflow:audit, audit, docker, networking, devops
---

# Docker Compose Networking: Audit

[Docker Compose Networking] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..

## When to use it
You need to examine the current "Docker Compose Networking" setup without making changes. Look for the specific failure pattern: "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Docker Compose Networking. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Use the best practice All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'. as your evaluation baseline. Verify your findings with docker compose up --wait + docker network inspect + container logs. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Docker Compose Networking setup" — produce an inventory of docker-compose.yml / network config / healthcheck / depends_on condition and flag issues related to Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.
- "Check Docker Compose Networking health" — run docker compose up --wait and summarise findings.
__USB_SKILL_54962B6DBD19F443__

write_file "$PACK_DIR/skills/docker-multistage-audit.md" <<'__USB_SKILL_0BD52FBD0E148906__'
---
description: "[Docker Multi-Stage Builds] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets multi-stage Dockerfile / .dockerignore / slim base image switch."
slug: docker-multistage-audit
name: Docker Multi-Stage Builds: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:docker-multistage, workflow:audit, audit, docker, build, devops
---

# Docker Multi-Stage Builds: Audit

[Docker Multi-Stage Builds] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..

## When to use it
You need to examine the current "Docker Multi-Stage Builds" setup without making changes. Look for the specific failure pattern: "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Docker Multi-Stage Builds. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Use the best practice Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app. as your evaluation baseline. Verify your findings with docker build + docker scout + dive layer analysis. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Docker Multi-Stage Builds setup" — produce an inventory of multi-stage Dockerfile / .dockerignore / slim base image switch and flag issues related to Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.
- "Check Docker Multi-Stage Builds health" — run docker build and summarise findings.
__USB_SKILL_0BD52FBD0E148906__

write_file "$PACK_DIR/skills/drizzle-schema-design-audit.md" <<'__USB_SKILL_7141D266A6C40846__'
---
description: "[Drizzle Schema Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets schema.ts / relation map / migration SQL / Drizzle query builder."
slug: drizzle-schema-design-audit
name: Drizzle Schema Design: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:drizzle-schema-design, workflow:audit, audit, drizzle, schema, database
---

# Drizzle Schema Design: Audit

[Drizzle Schema Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..

## When to use it
You need to examine the current "Drizzle Schema Design" setup without making changes. Look for the specific failure pattern: "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Drizzle Schema Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Use the best practice Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly. as your evaluation baseline. Verify your findings with drizzle-kit push + drizzle-kit studio + generated SQL audit. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Drizzle Schema Design setup" — produce an inventory of schema.ts / relation map / migration SQL / Drizzle query builder and flag issues related to Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.
- "Check Drizzle Schema Design health" — run drizzle-kit push and summarise findings.
__USB_SKILL_7141D266A6C40846__

write_file "$PACK_DIR/skills/error-monitoring-setup-audit.md" <<'__USB_SKILL_0D818A348EFB50F9__'
---
description: "[Error Monitoring & Alerting Setup] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring."
slug: error-monitoring-setup-audit
name: Error Monitoring & Alerting Setup: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:error-monitoring-setup, workflow:audit, audit, monitoring, errors, alerts
---

# Error Monitoring & Alerting Setup: Audit

[Error Monitoring & Alerting Setup] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..

## When to use it
You need to examine the current "Error Monitoring & Alerting Setup" setup without making changes. Look for the specific failure pattern: "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Error Monitoring & Alerting Setup. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Use the best practice Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold). as your evaluation baseline. Verify your findings with Sentry API error list + alert rule test + source map validation. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Error Monitoring & Alerting Setup setup" — produce an inventory of Sentry project config / alert rule / error grouping / source map upload / performance monitoring and flag issues related to Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.
- "Check Error Monitoring & Alerting Setup health" — run Sentry API error list and summarise findings.
__USB_SKILL_0D818A348EFB50F9__

write_file "$PACK_DIR/skills/fastapi-dependencies-audit.md" <<'__USB_SKILL_76322CD55CD929F2__'
---
description: "[FastAPI Dependency Injection] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets dependency / lifespan handler / override for testing."
slug: fastapi-dependencies-audit
name: FastAPI Dependency Injection: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:fastapi-dependencies, workflow:audit, audit, fastapi, dependencies, api
---

# FastAPI Dependency Injection: Audit

[FastAPI Dependency Injection] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..

## When to use it
You need to examine the current "FastAPI Dependency Injection" setup without making changes. Look for the specific failure pattern: "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing FastAPI Dependency Injection. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Use the best practice Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends(). as your evaluation baseline. Verify your findings with uvicorn --reload + /docs interactive test + dependency graph visualisation. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific dependency / lifespan handler / override for testing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current FastAPI Dependency Injection setup" — produce an inventory of dependency / lifespan handler / override for testing and flag issues related to Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.
- "Check FastAPI Dependency Injection health" — run uvicorn --reload and summarise findings.
__USB_SKILL_76322CD55CD929F2__

write_file "$PACK_DIR/skills/feature-flags-audit.md" <<'__USB_SKILL_5549A488AE52D4A2__'
---
description: "[Feature Flags & Gradual Rollouts] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag."
slug: feature-flags-audit
name: Feature Flags & Gradual Rollouts: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:feature-flags, workflow:audit, audit, feature-flags, rollout, devops
---

# Feature Flags & Gradual Rollouts: Audit

[Feature Flags & Gradual Rollouts] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..

## When to use it
You need to examine the current "Feature Flags & Gradual Rollouts" setup without making changes. Look for the specific failure pattern: "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Feature Flags & Gradual Rollouts. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Use the best practice Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely. as your evaluation baseline. Verify your findings with flag evaluation log + rollout percentage monitoring + unused flag scan. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Feature Flags & Gradual Rollouts setup" — produce an inventory of flag provider config / gradual rollout target / flag cleanup plan / A/B test flag and flag issues related to Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.
- "Check Feature Flags & Gradual Rollouts health" — run flag evaluation log and summarise findings.
__USB_SKILL_5549A488AE52D4A2__

write_file "$PACK_DIR/skills/git-conflict-resolution-audit.md" <<'__USB_SKILL_A1A98EB7013BB01C__'
---
description: "[Git Conflict Resolution] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message."
slug: git-conflict-resolution-audit
name: Git Conflict Resolution: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:git-conflict-resolution, workflow:audit, audit, git, conflicts, workflow
---

# Git Conflict Resolution: Audit

[Git Conflict Resolution] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..

## When to use it
You need to examine the current "Git Conflict Resolution" setup without making changes. Look for the specific failure pattern: "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Git Conflict Resolution. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Use the best practice For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution. as your evaluation baseline. Verify your findings with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Git Conflict Resolution setup" — produce an inventory of conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message and flag issues related to Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.
- "Check Git Conflict Resolution health" — run git log --oneline -5 -- <file> and summarise findings.
__USB_SKILL_A1A98EB7013BB01C__

write_file "$PACK_DIR/skills/github-actions-pipeline-audit.md" <<'__USB_SKILL_3A17E36B22190F72__'
---
description: "[GitHub Actions Pipeline Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets workflow YAML / cache config / matrix build / conditional job execution."
slug: github-actions-pipeline-audit
name: GitHub Actions Pipeline Optimisation: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:github-actions-pipeline, workflow:audit, audit, github-actions, ci, devops
---

# GitHub Actions Pipeline Optimisation: Audit

[GitHub Actions Pipeline Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..

## When to use it
You need to examine the current "GitHub Actions Pipeline Optimisation" setup without making changes. Look for the specific failure pattern: "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing GitHub Actions Pipeline Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Use the best practice Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs. as your evaluation baseline. Verify your findings with act --job test + cache hit/miss analysis + workflow graph visualisation. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific workflow YAML / cache config / matrix build / conditional job execution this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current GitHub Actions Pipeline Optimisation setup" — produce an inventory of workflow YAML / cache config / matrix build / conditional job execution and flag issues related to Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.
- "Check GitHub Actions Pipeline Optimisation health" — run act --job test and summarise findings.
__USB_SKILL_3A17E36B22190F72__

write_file "$PACK_DIR/skills/graphql-n-plus-one-audit.md" <<'__USB_SKILL_541A165A759FA4A1__'
---
description: "[GraphQL N+1 Query Prevention] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis."
slug: graphql-n-plus-one-audit
name: GraphQL N+1 Query Prevention: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:graphql-n-plus-one, workflow:audit, audit, graphql, n-plus-one, performance
---

# GraphQL N+1 Query Prevention: Audit

[GraphQL N+1 Query Prevention] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..

## When to use it
You need to examine the current "GraphQL N+1 Query Prevention" setup without making changes. Look for the specific failure pattern: "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing GraphQL N+1 Query Prevention. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Use the best practice Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle. as your evaluation baseline. Verify your findings with graphql query with tracing + DataLoader statistics + SQL log analysis. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current GraphQL N+1 Query Prevention setup" — produce an inventory of DataLoader instance / batch load function / resolver refactor / query complexity analysis and flag issues related to A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.
- "Check GraphQL N+1 Query Prevention health" — run graphql query with tracing and summarise findings.
__USB_SKILL_541A165A759FA4A1__

write_file "$PACK_DIR/skills/jest-test-optimization-audit.md" <<'__USB_SKILL_12F9F1E45D134046__'
---
description: "[Jest Test Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking."
slug: jest-test-optimization-audit
name: Jest Test Optimisation: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:jest-test-optimization, workflow:audit, audit, jest, testing, optimisation
---

# Jest Test Optimisation: Audit

[Jest Test Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..

## When to use it
You need to examine the current "Jest Test Optimisation" setup without making changes. Look for the specific failure pattern: "Running the entire test suite on every change, taking minutes even for small incremental code changes.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Jest Test Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Use the best practice Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback. as your evaluation baseline. Verify your findings with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Jest Test Optimisation setup" — produce an inventory of jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking and flag issues related to Running the entire test suite on every change, taking minutes even for small incremental code changes.
- "Check Jest Test Optimisation health" — run jest --changedSince=main --json and summarise findings.
__USB_SKILL_12F9F1E45D134046__

write_file "$PACK_DIR/skills/json-schema-validation-audit.md" <<'__USB_SKILL_EAA5C17ADC3F3498__'
---
description: "[JSON Schema Validation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets JSON Schema / validator middleware / type guard / error message / response parser."
slug: json-schema-validation-audit
name: JSON Schema Validation: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:json-schema-validation, workflow:audit, audit, json, validation, api
---

# JSON Schema Validation: Audit

[JSON Schema Validation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..

## When to use it
You need to examine the current "JSON Schema Validation" setup without making changes. Look for the specific failure pattern: "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing JSON Schema Validation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Use the best practice Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation. as your evaluation baseline. Verify your findings with ajv validate + JSON Schema test suite + response mock test. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current JSON Schema Validation setup" — produce an inventory of JSON Schema / validator middleware / type guard / error message / response parser and flag issues related to Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.
- "Check JSON Schema Validation health" — run ajv validate and summarise findings.
__USB_SKILL_EAA5C17ADC3F3498__

write_file "$PACK_DIR/skills/kubernetes-hpa-audit.md" <<'__USB_SKILL_16CA14EEBC994206__'
---
description: "[Kubernetes Horizontal Pod Autoscaling] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config."
slug: kubernetes-hpa-audit
name: Kubernetes Horizontal Pod Autoscaling: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-hpa, workflow:audit, audit, kubernetes, autoscaling, devops
---

# Kubernetes Horizontal Pod Autoscaling: Audit

[Kubernetes Horizontal Pod Autoscaling] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..

## When to use it
You need to examine the current "Kubernetes Horizontal Pod Autoscaling" setup without making changes. Look for the specific failure pattern: "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Kubernetes Horizontal Pod Autoscaling. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Use the best practice Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined. as your evaluation baseline. Verify your findings with kubectl get hpa --watch + kubectl top pods + metrics-server logs. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Kubernetes Horizontal Pod Autoscaling setup" — produce an inventory of HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config and flag issues related to HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.
- "Check Kubernetes Horizontal Pod Autoscaling health" — run kubectl get hpa --watch and summarise findings.
__USB_SKILL_16CA14EEBC994206__

write_file "$PACK_DIR/skills/kubernetes-pod-lifecycle-audit.md" <<'__USB_SKILL_D8DA4CD3ABDECF42__'
---
description: "[Kubernetes Pod Lifecycle] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container."
slug: kubernetes-pod-lifecycle-audit
name: Kubernetes Pod Lifecycle: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-pod-lifecycle, workflow:audit, audit, kubernetes, pods, devops
---

# Kubernetes Pod Lifecycle: Audit

[Kubernetes Pod Lifecycle] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..

## When to use it
You need to examine the current "Kubernetes Pod Lifecycle" setup without making changes. Look for the specific failure pattern: "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Kubernetes Pod Lifecycle. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Use the best practice Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity. as your evaluation baseline. Verify your findings with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Kubernetes Pod Lifecycle setup" — produce an inventory of deployment.yaml / startup probe / readiness probe / liveness probe / init container and flag issues related to Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.
- "Check Kubernetes Pod Lifecycle health" — run kubectl describe pod and summarise findings.
__USB_SKILL_D8DA4CD3ABDECF42__

write_file "$PACK_DIR/skills/context-window-budget-audit.md" <<'__USB_SKILL_69DF40EFEA2F0301__'
---
description: "[LLM Context Window Budget Management] Audit the current setup; do NOT modify files; produce a structured inventory and a risk-ranked list of findings Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard."
slug: context-window-budget-audit
name: LLM Context Window Budget Management: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:context-window-budget, workflow:audit, audit, context, tokens, llm, memory, summarization
---

# LLM Context Window Budget Management: Audit

[LLM Context Window Budget Management] Audit the current setup; do NOT modify files; produce a structured inventory and a risk-ranked list of findings Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..

## When to use it
You need to examine the current "LLM Context Window Budget Management" setup without making changes. Look for the specific failure pattern: "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing LLM Context Window Budget Management. Follow Audit the current setup; do NOT modify files; produce a structured inventory and a risk-ranked list of findings. Specifically check for: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Use the best practice Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible. as your evaluation baseline. Verify your findings with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves.

## Output contract
- **md** (markdown): MD output
- **chk** (checklist): CHK output

## Examples
- "Audit the current LLM Context Window Budget Management setup" — produce an inventory of trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard and flag issues related to Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content.
- "Check LLM Context Window Budget Management health" — run tiktoken count and summarise findings.
__USB_SKILL_69DF40EFEA2F0301__

write_file "$PACK_DIR/skills/mcp-tool-design-audit.md" <<'__USB_SKILL_6B3B3F9FBB01BF7F__'
---
description: "[MCP Tool Design & Best Practices] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets MCP tool descriptor / resource definition / prompt template / server metadata."
slug: mcp-tool-design-audit
name: MCP Tool Design & Best Practices: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:mcp-tool-design, workflow:audit, audit, mcp, tools, agents
---

# MCP Tool Design & Best Practices: Audit

[MCP Tool Design & Best Practices] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..

## When to use it
You need to examine the current "MCP Tool Design & Best Practices" setup without making changes. Look for the specific failure pattern: "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing MCP Tool Design & Best Practices. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Use the best practice Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool. as your evaluation baseline. Verify your findings with mcp-cli run + mcp inspector + tool name conflict analysis. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current MCP Tool Design & Best Practices setup" — produce an inventory of MCP tool descriptor / resource definition / prompt template / server metadata and flag issues related to Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.
- "Check MCP Tool Design & Best Practices health" — run mcp-cli run and summarise findings.
__USB_SKILL_6B3B3F9FBB01BF7F__

write_file "$PACK_DIR/skills/message-queues-audit.md" <<'__USB_SKILL_50CB411E44923E1A__'
---
description: "[Message Queues & Background Jobs] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets queue producer / worker / dead-letter handler / retry policy."
slug: message-queues-audit
name: Message Queues & Background Jobs: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:message-queues, workflow:audit, audit, queue, background-jobs, backend
---

# Message Queues & Background Jobs: Audit

[Message Queues & Background Jobs] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..

## When to use it
You need to examine the current "Message Queues & Background Jobs" setup without making changes. Look for the specific failure pattern: "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Message Queues & Background Jobs. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Use the best practice Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted. as your evaluation baseline. Verify your findings with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific queue producer / worker / dead-letter handler / retry policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Message Queues & Background Jobs setup" — produce an inventory of queue producer / worker / dead-letter handler / retry policy and flag issues related to Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.
- "Check Message Queues & Background Jobs health" — run Bull/BullMQ dashboard and summarise findings.
__USB_SKILL_50CB411E44923E1A__

write_file "$PACK_DIR/skills/multi-tenant-isolation-audit.md" <<'__USB_SKILL_937441263FFC14DD__'
---
description: "[Multi-Tenant Data Isolation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder."
slug: multi-tenant-isolation-audit
name: Multi-Tenant Data Isolation: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:multi-tenant-isolation, workflow:audit, audit, multi-tenant, saas, database
---

# Multi-Tenant Data Isolation: Audit

[Multi-Tenant Data Isolation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..

## When to use it
You need to examine the current "Multi-Tenant Data Isolation" setup without making changes. Look for the specific failure pattern: "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Multi-Tenant Data Isolation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Use the best practice Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause. as your evaluation baseline. Verify your findings with RLS policy test with two different tenant sessions + data leakage check. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Multi-Tenant Data Isolation setup" — produce an inventory of RLS policy / tenant context middleware / session variable injection / tenant-aware query builder and flag issues related to Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.
- "Check Multi-Tenant Data Isolation health" — run RLS policy test with two different tenant sessions and summarise findings.
__USB_SKILL_937441263FFC14DD__

write_file "$PACK_DIR/skills/nextjs-api-routes-audit.md" <<'__USB_SKILL_4010514A513572BE__'
---
description: "[Next.js API Routes & Route Handlers] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets route.ts handler / server action / API client wrapper / error boundary."
slug: nextjs-api-routes-audit
name: Next.js API Routes & Route Handlers: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-api-routes, workflow:audit, audit, nextjs, api, backend
---

# Next.js API Routes & Route Handlers: Audit

[Next.js API Routes & Route Handlers] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..

## When to use it
You need to examine the current "Next.js API Routes & Route Handlers" setup without making changes. Look for the specific failure pattern: "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Next.js API Routes & Route Handlers. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Use the best practice All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components. as your evaluation baseline. Verify your findings with curl --verbose + API route error log + status code audit. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific route.ts handler / server action / API client wrapper / error boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Next.js API Routes & Route Handlers setup" — produce an inventory of route.ts handler / server action / API client wrapper / error boundary and flag issues related to Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.
- "Check Next.js API Routes & Route Handlers health" — run curl --verbose and summarise findings.
__USB_SKILL_4010514A513572BE__

write_file "$PACK_DIR/skills/nextjs-data-fetching-audit.md" <<'__USB_SKILL_36E7B1544CAC866B__'
---
description: "[Next.js Data Fetching Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets server fetch / React cache wrapper / streaming suspense boundary."
slug: nextjs-data-fetching-audit
name: Next.js Data Fetching Patterns: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-data-fetching, workflow:audit, audit, nextjs, data-fetching, fullstack
---

# Next.js Data Fetching Patterns: Audit

[Next.js Data Fetching Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..

## When to use it
You need to examine the current "Next.js Data Fetching Patterns" setup without making changes. Look for the specific failure pattern: "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Next.js Data Fetching Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Use the best practice Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes. as your evaluation baseline. Verify your findings with next build --debug + React DevTools fetch profiling. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server fetch / React cache wrapper / streaming suspense boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Next.js Data Fetching Patterns setup" — produce an inventory of server fetch / React cache wrapper / streaming suspense boundary and flag issues related to Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.
- "Check Next.js Data Fetching Patterns health" — run next build --debug and summarise findings.
__USB_SKILL_36E7B1544CAC866B__

write_file "$PACK_DIR/skills/nextjs-middleware-audit.md" <<'__USB_SKILL_24F1898BF5E5B92E__'
---
description: "[Next.js Middleware & Edge Runtime] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing."
slug: nextjs-middleware-audit
name: Next.js Middleware & Edge Runtime: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-middleware, workflow:audit, audit, nextjs, middleware, edge
---

# Next.js Middleware & Edge Runtime: Audit

[Next.js Middleware & Edge Runtime] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..

## When to use it
You need to examine the current "Next.js Middleware & Edge Runtime" setup without making changes. Look for the specific failure pattern: "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Next.js Middleware & Edge Runtime. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Use the best practice Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks. as your evaluation baseline. Verify your findings with next dev + curl --cookie tests + edge runtime log inspection. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Next.js Middleware & Edge Runtime setup" — produce an inventory of middleware.ts / rewrite rule / cookie-based redirect / geolocation routing and flag issues related to Using Node.
- "Check Next.js Middleware & Edge Runtime health" — run next dev and summarise findings.
__USB_SKILL_24F1898BF5E5B92E__

write_file "$PACK_DIR/skills/node-error-handling-audit.md" <<'__USB_SKILL_757BD7F854660229__'
---
description: "[Node.js Error Handling & Resilience] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets global error handler / async wrapper / structured error response / retry logic."
slug: node-error-handling-audit
name: Node.js Error Handling & Resilience: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:node-error-handling, workflow:audit, audit, node, error-handling, backend
---

# Node.js Error Handling & Resilience: Audit

[Node.js Error Handling & Resilience] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..

## When to use it
You need to examine the current "Node.js Error Handling & Resilience" setup without making changes. Look for the specific failure pattern: "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Node.js Error Handling & Resilience. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Use the best practice Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function. as your evaluation baseline. Verify your findings with node --unhandled-rejections=strict + process.on('uncaughtException') log. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific global error handler / async wrapper / structured error response / retry logic this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Node.js Error Handling & Resilience setup" — produce an inventory of global error handler / async wrapper / structured error response / retry logic and flag issues related to Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.
- "Check Node.js Error Handling & Resilience health" — run node --unhandled-rejections=strict and summarise findings.
__USB_SKILL_757BD7F854660229__

write_file "$PACK_DIR/skills/node-streams-audit.md" <<'__USB_SKILL_AB8E1298F4565685__'
---
description: "[Node.js Streams & Backpressure] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Readable/Writable stream / Transform / pipeline() refactor."
slug: node-streams-audit
name: Node.js Streams & Backpressure: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:node-streams, workflow:audit, audit, node, streams, performance
---

# Node.js Streams & Backpressure: Audit

[Node.js Streams & Backpressure] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..

## When to use it
You need to examine the current "Node.js Streams & Backpressure" setup without making changes. Look for the specific failure pattern: "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Node.js Streams & Backpressure. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Use the best practice Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error. as your evaluation baseline. Verify your findings with Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Readable/Writable stream / Transform / pipeline() refactor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Node.js Streams & Backpressure setup" — produce an inventory of Readable/Writable stream / Transform / pipeline() refactor and flag issues related to Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.
- "Check Node.js Streams & Backpressure health" — run Node.js --inspect memory heap snapshot and summarise findings.
__USB_SKILL_AB8E1298F4565685__

write_file "$PACK_DIR/skills/oauth-flows-audit.md" <<'__USB_SKILL_4339CA0873FEEA59__'
---
description: "[OAuth 2.0 Flows & Token Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler."
slug: oauth-flows-audit
name: OAuth 2.0 Flows & Token Management: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:oauth-flows, workflow:audit, audit, oauth, auth, security
---

# OAuth 2.0 Flows & Token Management: Audit

[OAuth 2.0 Flows & Token Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..

## When to use it
You need to examine the current "OAuth 2.0 Flows & Token Management" setup without making changes. Look for the specific failure pattern: "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing OAuth 2.0 Flows & Token Management. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Use the best practice Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use. as your evaluation baseline. Verify your findings with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current OAuth 2.0 Flows & Token Management setup" — produce an inventory of OAuth callback / token refresh / PKCE flow / httpOnly cookie handler and flag issues related to Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.
- "Check OAuth 2.0 Flows & Token Management health" — run oauth2_proxy and summarise findings.
__USB_SKILL_4339CA0873FEEA59__

write_file "$PACK_DIR/skills/openapi-spec-audit.md" <<'__USB_SKILL_9465E9509E62E6CD__'
---
description: "[OpenAPI Specification & Validation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets openapi.yaml / code-first generator / request/response validation middleware."
slug: openapi-spec-audit
name: OpenAPI Specification & Validation: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:openapi-spec, workflow:audit, audit, openapi, api, contract
---

# OpenAPI Specification & Validation: Audit

[OpenAPI Specification & Validation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..

## When to use it
You need to examine the current "OpenAPI Specification & Validation" setup without making changes. Look for the specific failure pattern: "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing OpenAPI Specification & Validation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Use the best practice Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes. as your evaluation baseline. Verify your findings with redocly lint + openapi-diff + swagger-ui preview. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific openapi.yaml / code-first generator / request/response validation middleware this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current OpenAPI Specification & Validation setup" — produce an inventory of openapi.yaml / code-first generator / request/response validation middleware and flag issues related to Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.
- "Check OpenAPI Specification & Validation health" — run redocly lint and summarise findings.
__USB_SKILL_9465E9509E62E6CD__

write_file "$PACK_DIR/skills/playwright-selectors-audit.md" <<'__USB_SKILL_786DFFC0D1E5D906__'
---
description: "[Playwright Selectors & Locators] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture."
slug: playwright-selectors-audit
name: Playwright Selectors & Locators: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:playwright-selectors, workflow:audit, audit, playwright, testing, e2e
---

# Playwright Selectors & Locators: Audit

[Playwright Selectors & Locators] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..

## When to use it
You need to examine the current "Playwright Selectors & Locators" setup without making changes. Look for the specific failure pattern: "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Playwright Selectors & Locators. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Use the best practice Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes. as your evaluation baseline. Verify your findings with playwright test --reporter=html + playwright codegen + trace viewer. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Playwright Selectors & Locators setup" — produce an inventory of locator refactor / test fixture / POM (Page Object Model) / custom fixture and flag issues related to Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.
- "Check Playwright Selectors & Locators health" — run playwright test --reporter=html and summarise findings.
__USB_SKILL_786DFFC0D1E5D906__

write_file "$PACK_DIR/skills/prompt-injection-defense-audit.md" <<'__USB_SKILL_F574B1E3FCF0B1CD__'
---
description: "[Prompt Injection Defense] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator."
slug: prompt-injection-defense-audit
name: Prompt Injection Defense: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:prompt-injection-defense, workflow:audit, audit, prompt, security, llm
---

# Prompt Injection Defense: Audit

[Prompt Injection Defense] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..

## When to use it
You need to examine the current "Prompt Injection Defense" setup without making changes. Look for the specific failure pattern: "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Prompt Injection Defense. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Use the best practice Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts. as your evaluation baseline. Verify your findings with prompt injection test suite + adversarial input fuzzing + output scanner. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Prompt Injection Defense setup" — produce an inventory of defensive system prompt / input sanitizer / instruction guardrail / output validator and flag issues related to Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.
- "Check Prompt Injection Defense health" — run prompt injection test suite and summarise findings.
__USB_SKILL_F574B1E3FCF0B1CD__

write_file "$PACK_DIR/skills/python-async-audit.md" <<'__USB_SKILL_F1D8D7F2A1586195__'
---
description: "[Python Async/Await Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets async/await refactor / asyncio.gather / async context manager."
slug: python-async-audit
name: Python Async/Await Patterns: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:python-async, workflow:audit, audit, python, async, performance
---

# Python Async/Await Patterns: Audit

[Python Async/Await Patterns] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..

## When to use it
You need to examine the current "Python Async/Await Patterns" setup without making changes. Look for the specific failure pattern: "Blocking the event loop by using synchronous requests or time.sleep inside async functions.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Python Async/Await Patterns. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Use the best practice Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function. as your evaluation baseline. Verify your findings with python3 -m asyncio + aiohttp/httpx async benchmark. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific async/await refactor / asyncio.gather / async context manager this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Python Async/Await Patterns setup" — produce an inventory of async/await refactor / asyncio.gather / async context manager and flag issues related to Blocking the event loop by using synchronous requests or time.
- "Check Python Async/Await Patterns health" — run python3 -m asyncio and summarise findings.
__USB_SKILL_F1D8D7F2A1586195__

write_file "$PACK_DIR/skills/python-file-io-audit.md" <<'__USB_SKILL_2E3DAA7A8FAC4460__'
---
description: "[Python File I/O & Encoding] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets pathlib refactor / encoding-safe file reader / batch file processor."
slug: python-file-io-audit
name: Python File I/O & Encoding: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:python-file-io, workflow:audit, audit, python, file-io, scripting
---

# Python File I/O & Encoding: Audit

[Python File I/O & Encoding] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..

## When to use it
You need to examine the current "Python File I/O & Encoding" setup without making changes. Look for the specific failure pattern: "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Python File I/O & Encoding. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Use the best practice Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code. as your evaluation baseline. Verify your findings with python3 -c with open() + chardet encoding detection. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Python File I/O & Encoding setup" — produce an inventory of pathlib refactor / encoding-safe file reader / batch file processor and flag issues related to Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.
- "Check Python File I/O & Encoding health" — run python3 -c with open() and summarise findings.
__USB_SKILL_2E3DAA7A8FAC4460__

write_file "$PACK_DIR/skills/rag-chunking-audit.md" <<'__USB_SKILL_7BDABCB780E66D9A__'
---
description: "[RAG Chunking Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment."
slug: rag-chunking-audit
name: RAG Chunking Strategies: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:rag-chunking, workflow:audit, audit, rag, chunking, retrieval
---

# RAG Chunking Strategies: Audit

[RAG Chunking Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..

## When to use it
You need to examine the current "RAG Chunking Strategies" setup without making changes. Look for the specific failure pattern: "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing RAG Chunking Strategies. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Use the best practice Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries. as your evaluation baseline. Verify your findings with retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current RAG Chunking Strategies setup" — produce an inventory of semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment and flag issues related to Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.
- "Check RAG Chunking Strategies health" — run retrieval evaluation script and summarise findings.
__USB_SKILL_7BDABCB780E66D9A__

write_file "$PACK_DIR/skills/rate-limiting-proxy-audit.md" <<'__USB_SKILL_40568BC396B99522__'
---
description: "[Rate Limiting & API Gateway Proxy] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation."
slug: rate-limiting-proxy-audit
name: Rate Limiting & API Gateway Proxy: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:rate-limiting-proxy, workflow:audit, audit, rate-limiting, proxy, security
---

# Rate Limiting & API Gateway Proxy: Audit

[Rate Limiting & API Gateway Proxy] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..

## When to use it
You need to examine the current "Rate Limiting & API Gateway Proxy" setup without making changes. Look for the specific failure pattern: "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Rate Limiting & API Gateway Proxy. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Use the best practice Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server. as your evaluation baseline. Verify your findings with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Rate Limiting & API Gateway Proxy setup" — produce an inventory of NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation and flag issues related to Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.
- "Check Rate Limiting & API Gateway Proxy health" — run ab -n 1000 -c 10 and summarise findings.
__USB_SKILL_40568BC396B99522__

write_file "$PACK_DIR/skills/react-server-components-audit.md" <<'__USB_SKILL_675FDEBC2EAE93B1__'
---
description: "[React Server Components] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets server component / client boundary refactor / streaming fallback."
slug: react-server-components-audit
name: React Server Components: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:react-server-components, workflow:audit, audit, react, rsc, frontend
---

# React Server Components: Audit

[React Server Components] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..

## When to use it
You need to examine the current "React Server Components" setup without making changes. Look for the specific failure pattern: "Accidentally making a server component a client component by using hooks or event handlers in the wrong file.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing React Server Components. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Use the best practice Keep data fetching and heavy logic in server components; pass results as props to client islands. as your evaluation baseline. Verify your findings with next build --debug + React Server Components lint rule. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server component / client boundary refactor / streaming fallback this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current React Server Components setup" — produce an inventory of server component / client boundary refactor / streaming fallback and flag issues related to Accidentally making a server component a client component by using hooks or event handlers in the wrong file.
- "Check React Server Components health" — run next build --debug and summarise findings.
__USB_SKILL_675FDEBC2EAE93B1__

write_file "$PACK_DIR/skills/react-state-audit.md" <<'__USB_SKILL_34B79AF0D0EBAD4B__'
---
description: "[React State Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice."
slug: react-state-audit
name: React State Management: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:react-state, workflow:audit, audit, react, state, frontend
---

# React State Management: Audit

[React State Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..

## When to use it
You need to examine the current "React State Management" setup without making changes. Look for the specific failure pattern: "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing React State Management. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Use the best practice Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it. as your evaluation baseline. Verify your findings with React DevTools profiler + why-did-you-render. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current React State Management setup" — produce an inventory of useState / useReducer / useContext hook refactor, zustand or jotai store slice and flag issues related to Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.
- "Check React State Management health" — run React DevTools profiler and summarise findings.
__USB_SKILL_34B79AF0D0EBAD4B__

write_file "$PACK_DIR/skills/redis-caching-audit.md" <<'__USB_SKILL_2CB8958863B99374__'
---
description: "[Redis Caching Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy."
slug: redis-caching-audit
name: Redis Caching Strategies: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:redis-caching, workflow:audit, audit, redis, caching, performance
---

# Redis Caching Strategies: Audit

[Redis Caching Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..

## When to use it
You need to examine the current "Redis Caching Strategies" setup without making changes. Look for the specific failure pattern: "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Redis Caching Strategies. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Use the best practice Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed. as your evaluation baseline. Verify your findings with redis-cli --stat + cache hit ratio monitoring + slow log. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Redis Caching Strategies setup" — produce an inventory of cache wrapper / mutex lock / stale-while-revalidate / TTL policy and flag issues related to Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.
- "Check Redis Caching Strategies health" — run redis-cli --stat and summarise findings.
__USB_SKILL_2CB8958863B99374__

write_file "$PACK_DIR/skills/rest-pagination-audit.md" <<'__USB_SKILL_F61038901AD9349F__'
---
description: "[REST Pagination Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope."
slug: rest-pagination-audit
name: REST Pagination Design: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:rest-pagination, workflow:audit, audit, rest, pagination, api
---

# REST Pagination Design: Audit

[REST Pagination Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..

## When to use it
You need to examine the current "REST Pagination Design" setup without making changes. Look for the specific failure pattern: "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing REST Pagination Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Use the best practice Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value. as your evaluation baseline. Verify your findings with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current REST Pagination Design setup" — produce an inventory of cursor pagination / offset pagination fallback / total count optimisation / response envelope and flag issues related to Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.
- "Check REST Pagination Design health" — run curl with cursor param and summarise findings.
__USB_SKILL_F61038901AD9349F__

write_file "$PACK_DIR/skills/secrets-rotation-audit.md" <<'__USB_SKILL_2D0570911534A265__'
---
description: "[Secrets Rotation Policy] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets rotation script / vault integration / lease management / incident response plan."
slug: secrets-rotation-audit
name: Secrets Rotation Policy: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:secrets-rotation, workflow:audit, audit, secrets, security, rotation
---

# Secrets Rotation Policy: Audit

[Secrets Rotation Policy] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..

## When to use it
You need to examine the current "Secrets Rotation Policy" setup without making changes. Look for the specific failure pattern: "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Secrets Rotation Policy. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Use the best practice Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files. as your evaluation baseline. Verify your findings with vault lease list + secret expiry check + rotation dry-run test. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific rotation script / vault integration / lease management / incident response plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Secrets Rotation Policy setup" — produce an inventory of rotation script / vault integration / lease management / incident response plan and flag issues related to Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.
- "Check Secrets Rotation Policy health" — run vault lease list and summarise findings.
__USB_SKILL_2D0570911534A265__

write_file "$PACK_DIR/skills/shell-script-robustness-audit.md" <<'__USB_SKILL_684009483666E7B2__'
---
description: "[Shell Script Robustness & Safety] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function."
slug: shell-script-robustness-audit
name: Shell Script Robustness & Safety: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:shell-script-robustness, workflow:audit, audit, shell, scripting, safety
---

# Shell Script Robustness & Safety: Audit

[Shell Script Robustness & Safety] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..

## When to use it
You need to examine the current "Shell Script Robustness & Safety" setup without making changes. Look for the specific failure pattern: "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Shell Script Robustness & Safety. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Use the best practice Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script. as your evaluation baseline. Verify your findings with shellcheck script.sh + bash -n script.sh + dry-run mode test. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Shell Script Robustness & Safety setup" — produce an inventory of set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function and flag issues related to Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.
- "Check Shell Script Robustness & Safety health" — run shellcheck script.sh and summarise findings.
__USB_SKILL_684009483666E7B2__

write_file "$PACK_DIR/skills/sql-query-optimization-audit.md" <<'__USB_SKILL_B909C5138F44D069__'
---
description: "[SQL Query Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index."
slug: sql-query-optimization-audit
name: SQL Query Optimisation: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:sql-query-optimization, workflow:audit, audit, sql, optimization, database
---

# SQL Query Optimisation: Audit

[SQL Query Optimisation] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..

## When to use it
You need to examine the current "SQL Query Optimisation" setup without making changes. Look for the specific failure pattern: "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing SQL Query Optimisation. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Use the best practice Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly. as your evaluation baseline. Verify your findings with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current SQL Query Optimisation setup" — produce an inventory of indexed query / composite index / EXPLAIN ANALYSE plan / partial index and flag issues related to Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.
- "Check SQL Query Optimisation health" — run EXPLAIN (ANALYSE, BUFFERS) and summarise findings.
__USB_SKILL_B909C5138F44D069__

write_file "$PACK_DIR/skills/stealth-web-research-audit.md" <<'__USB_SKILL_ADC1F350331AA4DE__'
---
description: "[Stealth Web Research & Harvesting] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages."
slug: stealth-web-research-audit
name: Stealth Web Research & Harvesting: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:stealth-web-research, workflow:audit, audit, stealth, scraping, research, anti-bot
---

# Stealth Web Research & Harvesting: Audit

[Stealth Web Research & Harvesting] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..

## When to use it
You need to examine the current "Stealth Web Research & Harvesting" setup without making changes. Look for the specific failure pattern: "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Stealth Web Research & Harvesting. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Use the best practice Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers. as your evaluation baseline. Verify your findings with playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Stealth Web Research & Harvesting setup" — produce an inventory of clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages and flag issues related to Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.
- "Check Stealth Web Research & Harvesting health" — run playwright-extra and summarise findings.
__USB_SKILL_ADC1F350331AA4DE__

write_file "$PACK_DIR/skills/stripe-webhook-idempotency-audit.md" <<'__USB_SKILL_F08AC66C85FBBAE9__'
---
description: "[Stripe Webhook Idempotency] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery."
slug: stripe-webhook-idempotency-audit
name: Stripe Webhook Idempotency: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:stripe-webhook-idempotency, workflow:audit, audit, stripe, webhook, payments
---

# Stripe Webhook Idempotency: Audit

[Stripe Webhook Idempotency] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..

## When to use it
You need to examine the current "Stripe Webhook Idempotency" setup without making changes. Look for the specific failure pattern: "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Stripe Webhook Idempotency. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Use the best practice Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events. as your evaluation baseline. Verify your findings with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Stripe Webhook Idempotency setup" — produce an inventory of Webhook handler / idempotency key check / event deduplication / failed payment recovery and flag issues related to Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.
- "Check Stripe Webhook Idempotency health" — run stripe trigger payment_intent.succeeded and summarise findings.
__USB_SKILL_F08AC66C85FBBAE9__

write_file "$PACK_DIR/skills/supabase-rls-audit.md" <<'__USB_SKILL_37EED2AEE5062859__'
---
description: "[Supabase Row-Level Security] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets RLS policy / policy test / security definer function / admin bypass."
slug: supabase-rls-audit
name: Supabase Row-Level Security: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:supabase-rls, workflow:audit, audit, supabase, rls, security
---

# Supabase Row-Level Security: Audit

[Supabase Row-Level Security] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..

## When to use it
You need to examine the current "Supabase Row-Level Security" setup without making changes. Look for the specific failure pattern: "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Supabase Row-Level Security. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Use the best practice Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production. as your evaluation baseline. Verify your findings with supabase db check + supabase db test + RLS policy review with pg_policies. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / policy test / security definer function / admin bypass this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Supabase Row-Level Security setup" — produce an inventory of RLS policy / policy test / security definer function / admin bypass and flag issues related to RLS policies that are too permissive (using 'true' instead of 'auth.
- "Check Supabase Row-Level Security health" — run supabase db check and summarise findings.
__USB_SKILL_37EED2AEE5062859__

write_file "$PACK_DIR/skills/terraform-state-audit.md" <<'__USB_SKILL_074CFD37F603DA92__'
---
description: "[Terraform State Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets backend config / state migration plan / state locking config / remote state datasource."
slug: terraform-state-audit
name: Terraform State Management: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:terraform-state, workflow:audit, audit, terraform, state, iac
---

# Terraform State Management: Audit

[Terraform State Management] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..

## When to use it
You need to examine the current "Terraform State Management" setup without making changes. Look for the specific failure pattern: "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Terraform State Management. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Use the best practice Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent. as your evaluation baseline. Verify your findings with terraform plan + terraform state list + terraform state pull | jq. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific backend config / state migration plan / state locking config / remote state datasource this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Terraform State Management setup" — produce an inventory of backend config / state migration plan / state locking config / remote state datasource and flag issues related to Losing the .
- "Check Terraform State Management health" — run terraform plan and summarise findings.
__USB_SKILL_074CFD37F603DA92__

write_file "$PACK_DIR/skills/typescript-generics-audit.md" <<'__USB_SKILL_CB854985CBD6487C__'
---
description: "[TypeScript Generics & Advanced Types] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets generic type / conditional type / mapped type / branded type."
slug: typescript-generics-audit
name: TypeScript Generics & Advanced Types: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:typescript-generics, workflow:audit, audit, typescript, generics, type-system
---

# TypeScript Generics & Advanced Types: Audit

[TypeScript Generics & Advanced Types] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..

## When to use it
You need to examine the current "TypeScript Generics & Advanced Types" setup without making changes. Look for the specific failure pattern: "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing TypeScript Generics & Advanced Types. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Use the best practice Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property. as your evaluation baseline. Verify your findings with tsc --noEmit --strict + type tests with expect-type. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific generic type / conditional type / mapped type / branded type this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current TypeScript Generics & Advanced Types setup" — produce an inventory of generic type / conditional type / mapped type / branded type and flag issues related to Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).
- "Check TypeScript Generics & Advanced Types health" — run tsc --noEmit --strict and summarise findings.
__USB_SKILL_CB854985CBD6487C__

write_file "$PACK_DIR/skills/user-onboarding-flow-audit.md" <<'__USB_SKILL_CF59D51177BB792D__'
---
description: "[User Onboarding Flow Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec."
slug: user-onboarding-flow-audit
name: User Onboarding Flow Design: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:user-onboarding-flow, workflow:audit, audit, ux, onboarding, product
---

# User Onboarding Flow Design: Audit

[User Onboarding Flow Design] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..

## When to use it
You need to examine the current "User Onboarding Flow Design" setup without making changes. Look for the specific failure pattern: "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing User Onboarding Flow Design. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Use the best practice Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal. as your evaluation baseline. Verify your findings with analytics funnel analysis + onboarding completion rate + drop-off heatmap. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current User Onboarding Flow Design setup" — produce an inventory of onboarding wizard / feature checklist / in-app guide / first-run experience spec and flag issues related to Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.
- "Check User Onboarding Flow Design health" — run analytics funnel analysis and summarise findings.
__USB_SKILL_CF59D51177BB792D__

write_file "$PACK_DIR/skills/vercel-env-vars-audit.md" <<'__USB_SKILL_D1162C663F6EA90C__'
---
description: "[Vercel Environment Variables] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets vercel.json env group / preview env config / Edge Config / KV store."
slug: vercel-env-vars-audit
name: Vercel Environment Variables: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:vercel-env-vars, workflow:audit, audit, vercel, env, deployment
---

# Vercel Environment Variables: Audit

[Vercel Environment Variables] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..

## When to use it
You need to examine the current "Vercel Environment Variables" setup without making changes. Look for the specific failure pattern: "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Vercel Environment Variables. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Use the best practice Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'. as your evaluation baseline. Verify your findings with vercel env pull + vercel list + project settings audit. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific vercel.json env group / preview env config / Edge Config / KV store this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Vercel Environment Variables setup" — produce an inventory of vercel.json env group / preview env config / Edge Config / KV store and flag issues related to Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.
- "Check Vercel Environment Variables health" — run vercel env pull and summarise findings.
__USB_SKILL_D1162C663F6EA90C__

write_file "$PACK_DIR/skills/web-scraping-ethics-audit.md" <<'__USB_SKILL_7CDB1D719859A266__'
---
description: "[Web Scraping Ethics & Compliance] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper."
slug: web-scraping-ethics-audit
name: Web Scraping Ethics & Compliance: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:web-scraping-ethics, workflow:audit, audit, scraping, ethics, research
---

# Web Scraping Ethics & Compliance: Audit

[Web Scraping Ethics & Compliance] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..

## When to use it
You need to examine the current "Web Scraping Ethics & Compliance" setup without making changes. Look for the specific failure pattern: "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Web Scraping Ethics & Compliance. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Use the best practice Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information. as your evaluation baseline. Verify your findings with curl robots.txt + wget --wait + scraper log audit. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Web Scraping Ethics & Compliance setup" — produce an inventory of robots.txt check / polite scraper / rate-limited crawler / cached scraper and flag issues related to Scraping a website that explicitly prohibits it in robots.
- "Check Web Scraping Ethics & Compliance health" — run curl robots.txt and summarise findings.
__USB_SKILL_7CDB1D719859A266__

write_file "$PACK_DIR/skills/websocket-reconnection-audit.md" <<'__USB_SKILL_75CA8196B079BD47__'
---
description: "[WebSocket Reconnection Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets WebSocket client / reconnection logic / heartbeat / connection status component."
slug: websocket-reconnection-audit
name: WebSocket Reconnection Strategies: Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:websocket-reconnection, workflow:audit, audit, websocket, realtime, frontend
---

# WebSocket Reconnection Strategies: Audit

[WebSocket Reconnection Strategies] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..

## When to use it
You need to examine the current "WebSocket Reconnection Strategies" setup without making changes. Look for the specific failure pattern: "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing WebSocket Reconnection Strategies. Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Use the best practice Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI. as your evaluation baseline. Verify your findings with Browser DevTools Network tab WS filter + reconnection test with server restart. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current WebSocket Reconnection Strategies setup" — produce an inventory of WebSocket client / reconnection logic / heartbeat / connection status component and flag issues related to Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.
- "Check WebSocket Reconnection Strategies health" — run Browser DevTools Network tab WS filter and summarise findings.
__USB_SKILL_75CA8196B079BD47__

write_file "$PACK_DIR/skills/web-vitals-optimization-audit.md" <<'__USB_SKILL_57F047A1238E18DD__'
---
description: "[Web Vitals Optimisation (LCP/CLS/INP)] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis."
slug: web-vitals-optimization-audit
name: Web Vitals Optimisation (LCP/CLS/INP): Audit
category: Audit
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:web-vitals-optimization, workflow:audit, audit, performance, web-vitals, optimisation
---

# Web Vitals Optimisation (LCP/CLS/INP): Audit

[Web Vitals Optimisation (LCP/CLS/INP)] Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..

## When to use it
You need to examine the current "Web Vitals Optimisation (LCP/CLS/INP)" setup without making changes. Look for the specific failure pattern: "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).". Call this when you want a structured inventory before deciding what to modify.

## Protocol
You are auditing Web Vitals Optimisation (LCP/CLS/INP). Follow Inspect the current state without making changes. List files, configurations, dependencies, or outputs relevant to the goal. Produce a structured inventory with findings, risks, and recommendations — but do not modify anything.. Specifically check for: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Use the best practice Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation. as your evaluation baseline. Verify your findings with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Do not modify any files.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Audit the current Web Vitals Optimisation (LCP/CLS/INP) setup" — produce an inventory of image optimisation / font display swap / critical CSS / lazy load / bundle analysis and flag issues related to Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).
- "Check Web Vitals Optimisation (LCP/CLS/INP) health" — run Lighthouse CI and summarise findings.
__USB_SKILL_57F047A1238E18DD__

write_file "$PACK_DIR/skills/a-b-testing-framework-script.md" <<'__USB_SKILL_9C7AF0636D47F2FB__'
---
description: "[A/B Testing Framework] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets experiment spec / variant assignment / metric definition / statistical analysis script."
slug: a-b-testing-framework-script
name: A/B Testing Framework: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:a-b-testing-framework, workflow:script, automation, ab-testing, experiments, product
---

# A/B Testing Framework: Script

[A/B Testing Framework] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..

## When to use it
Create a reusable automation for "A/B Testing Framework". The task produces experiment spec / variant assignment / metric definition / statistical analysis script. Handle the failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.". Include a dry-run mode and test with statsmodels sample size calculation + Bayesian A/B test + sequential testing.

## Protocol
You are automating a workflow for A/B Testing Framework. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with experiment spec / variant assignment / metric definition / statistical analysis script. Guard against: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Test with statsmodels sample size calculation + Bayesian A/B test + sequential testing.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the A/B Testing Framework process" — produce a reusable CLI that handles Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.
- "Automate A/B Testing Framework" — create a dry-run mode and test with statsmodels sample size calculation.
__USB_SKILL_9C7AF0636D47F2FB__

write_file "$PACK_DIR/skills/a11y-aria-patterns-script.md" <<'__USB_SKILL_52171E70B9CED1B6__'
---
description: "[Accessibility ARIA Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script."
slug: a11y-aria-patterns-script
name: Accessibility ARIA Patterns: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:a11y-aria-patterns, workflow:script, automation, accessibility, aria, testing
---

# Accessibility ARIA Patterns: Script

[Accessibility ARIA Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..

## When to use it
Create a reusable automation for "Accessibility ARIA Patterns". The task produces ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Handle the failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.". Include a dry-run mode and test with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit.

## Protocol
You are automating a workflow for Accessibility ARIA Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Guard against: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Test with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Accessibility ARIA Patterns process" — produce a reusable CLI that handles Adding ARIA attributes that conflict with native HTML semantics (e.
- "Automate Accessibility ARIA Patterns" — create a dry-run mode and test with axe-core.
__USB_SKILL_52171E70B9CED1B6__

write_file "$PACK_DIR/skills/agent-tool-binding-script.md" <<'__USB_SKILL_136232173F93038B__'
---
description: "[Agent Tool Binding & Dispatch] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets router tool / domain group / dynamic tool injection / tool usage statistics."
slug: agent-tool-binding-script
name: Agent Tool Binding & Dispatch: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:agent-tool-binding, workflow:script, automation, agents, tool-binding, orchestration
---

# Agent Tool Binding & Dispatch: Script

[Agent Tool Binding & Dispatch] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..

## When to use it
Create a reusable automation for "Agent Tool Binding & Dispatch". The task produces router tool / domain group / dynamic tool injection / tool usage statistics. Handle the failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.". Include a dry-run mode and test with agent trace log + tool invocation frequency analysis + token cost audit.

## Protocol
You are automating a workflow for Agent Tool Binding & Dispatch. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with router tool / domain group / dynamic tool injection / tool usage statistics. Guard against: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Test with agent trace log + tool invocation frequency analysis + token cost audit.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Agent Tool Binding & Dispatch process" — produce a reusable CLI that handles Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.
- "Automate Agent Tool Binding & Dispatch" — create a dry-run mode and test with agent trace log.
__USB_SKILL_136232173F93038B__

write_file "$PACK_DIR/skills/analytics-metric-definition-script.md" <<'__USB_SKILL_06EE5A70218E2EE0__'
---
description: "[Analytics Metric Definitions] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation."
slug: analytics-metric-definition-script
name: Analytics Metric Definitions: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:analytics-metric-definition, workflow:script, automation, analytics, metrics, data
---

# Analytics Metric Definitions: Script

[Analytics Metric Definitions] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..

## When to use it
Create a reusable automation for "Analytics Metric Definitions". The task produces metric definition / dbt model / SQL logic / dashboard tile / documentation. Handle the failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.". Include a dry-run mode and test with dbt docs generate + dbt test --select tag:metrics + metric comparison script.

## Protocol
You are automating a workflow for Analytics Metric Definitions. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with metric definition / dbt model / SQL logic / dashboard tile / documentation. Guard against: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Test with dbt docs generate + dbt test --select tag:metrics + metric comparison script.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Analytics Metric Definitions process" — produce a reusable CLI that handles Different teams computing the same metric (e.
- "Automate Analytics Metric Definitions" — create a dry-run mode and test with dbt docs generate.
__USB_SKILL_06EE5A70218E2EE0__

write_file "$PACK_DIR/skills/adr-documentation-script.md" <<'__USB_SKILL_F37655E12445D984__'
---
description: "[Architecture Decision Records] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets ADR document / decision log / template / review workflow."
slug: adr-documentation-script
name: Architecture Decision Records: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:adr-documentation, workflow:script, automation, documentation, adr, architecture
---

# Architecture Decision Records: Script

[Architecture Decision Records] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..

## When to use it
Create a reusable automation for "Architecture Decision Records". The task produces ADR document / decision log / template / review workflow. Handle the failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.". Include a dry-run mode and test with adr-tools list + adr-tools generate + decision log index page.

## Protocol
You are automating a workflow for Architecture Decision Records. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with ADR document / decision log / template / review workflow. Guard against: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Test with adr-tools list + adr-tools generate + decision log index page.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ADR document / decision log / template / review workflow this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Architecture Decision Records process" — produce a reusable CLI that handles Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.
- "Automate Architecture Decision Records" — create a dry-run mode and test with adr-tools list.
__USB_SKILL_F37655E12445D984__

write_file "$PACK_DIR/skills/aws-lambda-cold-start-script.md" <<'__USB_SKILL_BD4E9F0DB652FED5__'
---
description: "[AWS Lambda Cold Starts] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function."
slug: aws-lambda-cold-start-script
name: AWS Lambda Cold Starts: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:aws-lambda-cold-start, workflow:script, automation, aws, lambda, performance
---

# AWS Lambda Cold Starts: Script

[AWS Lambda Cold Starts] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..

## When to use it
Create a reusable automation for "AWS Lambda Cold Starts". The task produces handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Handle the failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.". Include a dry-run mode and test with AWS X-Ray trace + Lambda Insights + cold start dashboard.

## Protocol
You are automating a workflow for AWS Lambda Cold Starts. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Guard against: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Test with AWS X-Ray trace + Lambda Insights + cold start dashboard.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the AWS Lambda Cold Starts process" — produce a reusable CLI that handles Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.
- "Automate AWS Lambda Cold Starts" — create a dry-run mode and test with AWS X-Ray trace.
__USB_SKILL_BD4E9F0DB652FED5__

write_file "$PACK_DIR/skills/azure-bicep-script.md" <<'__USB_SKILL_572BADD451DBA0C4__'
---
description: "[Azure Bicep Infrastructure] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets main.bicep / module / parameter file / azd template."
slug: azure-bicep-script
name: Azure Bicep Infrastructure: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:azure-bicep, workflow:script, automation, azure, bicep, iac
---

# Azure Bicep Infrastructure: Script

[Azure Bicep Infrastructure] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..

## When to use it
Create a reusable automation for "Azure Bicep Infrastructure". The task produces main.bicep / module / parameter file / azd template. Handle the failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.". Include a dry-run mode and test with az deployment group validate + az what-if + bicep build.

## Protocol
You are automating a workflow for Azure Bicep Infrastructure. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with main.bicep / module / parameter file / azd template. Guard against: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Test with az deployment group validate + az what-if + bicep build.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific main.bicep / module / parameter file / azd template this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Azure Bicep Infrastructure process" — produce a reusable CLI that handles Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.
- "Automate Azure Bicep Infrastructure" — create a dry-run mode and test with az deployment group validate.
__USB_SKILL_572BADD451DBA0C4__

write_file "$PACK_DIR/skills/browser-devtools-script.md" <<'__USB_SKILL_CD6509EC91170BA5__'
---
description: "[Browser DevTools & Debugging] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot."
slug: browser-devtools-script
name: Browser DevTools & Debugging: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:browser-devtools, workflow:script, automation, browser, debugging, devtools
---

# Browser DevTools & Debugging: Script

[Browser DevTools & Debugging] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..

## When to use it
Create a reusable automation for "Browser DevTools & Debugging". The task produces debugging workflow / breakpoint guide / performance recording / memory snapshot. Handle the failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.". Include a dry-run mode and test with Chrome DevTools performance recording + memory heap snapshot + network throttle.

## Protocol
You are automating a workflow for Browser DevTools & Debugging. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with debugging workflow / breakpoint guide / performance recording / memory snapshot. Guard against: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Test with Chrome DevTools performance recording + memory heap snapshot + network throttle.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Browser DevTools & Debugging process" — produce a reusable CLI that handles Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.
- "Automate Browser DevTools & Debugging" — create a dry-run mode and test with Chrome DevTools performance recording.
__USB_SKILL_CD6509EC91170BA5__

write_file "$PACK_DIR/skills/cli-tool-design-script.md" <<'__USB_SKILL_258B508FEFD176EE__'
---
description: "[CLI Tool Design Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CLI scaffolding / argument parser / exit code handler / --json output mode."
slug: cli-tool-design-script
name: CLI Tool Design Patterns: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cli-tool-design, workflow:script, automation, cli, devtools, scripting
---

# CLI Tool Design Patterns: Script

[CLI Tool Design Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..

## When to use it
Create a reusable automation for "CLI Tool Design Patterns". The task produces CLI scaffolding / argument parser / exit code handler / --json output mode. Handle the failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.". Include a dry-run mode and test with echo $? after CLI run + stderr redirection test + --json output validation.

## Protocol
You are automating a workflow for CLI Tool Design Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with CLI scaffolding / argument parser / exit code handler / --json output mode. Guard against: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Test with echo $? after CLI run + stderr redirection test + --json output validation.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the CLI Tool Design Patterns process" — produce a reusable CLI that handles Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.
- "Automate CLI Tool Design Patterns" — create a dry-run mode and test with echo $? after CLI run.
__USB_SKILL_258B508FEFD176EE__

write_file "$PACK_DIR/skills/cloud-cost-optimization-script.md" <<'__USB_SKILL_DBEDF133AE9C9953__'
---
description: "[Cloud Cost Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report."
slug: cloud-cost-optimization-script
name: Cloud Cost Optimisation: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cloud-cost-optimization, workflow:script, automation, cloud, cost, optimization
---

# Cloud Cost Optimisation: Script

[Cloud Cost Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..

## When to use it
Create a reusable automation for "Cloud Cost Optimisation". The task produces right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Handle the failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.". Include a dry-run mode and test with cloud cost explorer + instance utilisation report + auto-stop Lambda function test.

## Protocol
You are automating a workflow for Cloud Cost Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Guard against: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Test with cloud cost explorer + instance utilisation report + auto-stop Lambda function test.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Cloud Cost Optimisation process" — produce a reusable CLI that handles Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.
- "Automate Cloud Cost Optimisation" — create a dry-run mode and test with cloud cost explorer.
__USB_SKILL_DBEDF133AE9C9953__

write_file "$PACK_DIR/skills/code-review-checklist-script.md" <<'__USB_SKILL_5AD2F316B88A0EE8__'
---
description: "[Code Review Checklist] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets review checklist / automated review comment / risk classification / diff summary."
slug: code-review-checklist-script
name: Code Review Checklist: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:code-review-checklist, workflow:script, automation, code-review, quality, checklist
---

# Code Review Checklist: Script

[Code Review Checklist] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..

## When to use it
Create a reusable automation for "Code Review Checklist". The task produces review checklist / automated review comment / risk classification / diff summary. Handle the failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.". Include a dry-run mode and test with git diff --stat + lint-staged + danger.js automated review + commitlint.

## Protocol
You are automating a workflow for Code Review Checklist. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with review checklist / automated review comment / risk classification / diff summary. Guard against: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Test with git diff --stat + lint-staged + danger.js automated review + commitlint.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific review checklist / automated review comment / risk classification / diff summary this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Code Review Checklist process" — produce a reusable CLI that handles Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.
- "Automate Code Review Checklist" — create a dry-run mode and test with git diff --stat.
__USB_SKILL_5AD2F316B88A0EE8__

write_file "$PACK_DIR/skills/convex-functions-script.md" <<'__USB_SKILL_13FCF95F3C40C157__'
---
description: "[Convex Functions & Mutations] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets mutation / query / action / component / scheduler job."
slug: convex-functions-script
name: Convex Functions & Mutations: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:convex-functions, workflow:script, automation, convex, realtime, backend
---

# Convex Functions & Mutations: Script

[Convex Functions & Mutations] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..

## When to use it
Create a reusable automation for "Convex Functions & Mutations". The task produces mutation / query / action / component / scheduler job. Handle the failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.". Include a dry-run mode and test with npx convex dev + dashboard OCC conflict log + custom retry logic.

## Protocol
You are automating a workflow for Convex Functions & Mutations. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with mutation / query / action / component / scheduler job. Guard against: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Test with npx convex dev + dashboard OCC conflict log + custom retry logic.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific mutation / query / action / component / scheduler job this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Convex Functions & Mutations process" — produce a reusable CLI that handles Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.
- "Automate Convex Functions & Mutations" — create a dry-run mode and test with npx convex dev.
__USB_SKILL_13FCF95F3C40C157__

write_file "$PACK_DIR/skills/cron-job-reliability-script.md" <<'__USB_SKILL_FF741B111E55B50E__'
---
description: "[Cron Job & Scheduled Task Reliability] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets crontab entry / log rotation / idempotency guard / failure alert integration."
slug: cron-job-reliability-script
name: Cron Job & Scheduled Task Reliability: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cron-job-reliability, workflow:script, automation, cron, scheduling, reliability
---

# Cron Job & Scheduled Task Reliability: Script

[Cron Job & Scheduled Task Reliability] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..

## When to use it
Create a reusable automation for "Cron Job & Scheduled Task Reliability". The task produces crontab entry / log rotation / idempotency guard / failure alert integration. Handle the failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.". Include a dry-run mode and test with tail -f /var/log/cron + systemctl status cron + idempotency test script.

## Protocol
You are automating a workflow for Cron Job & Scheduled Task Reliability. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with crontab entry / log rotation / idempotency guard / failure alert integration. Guard against: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Test with tail -f /var/log/cron + systemctl status cron + idempotency test script.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Cron Job & Scheduled Task Reliability process" — produce a reusable CLI that handles Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.
- "Automate Cron Job & Scheduled Task Reliability" — create a dry-run mode and test with tail -f /var/log/cron.
__USB_SKILL_FF741B111E55B50E__

write_file "$PACK_DIR/skills/css-layout-script.md" <<'__USB_SKILL_1F911D2B756B8110__'
---
description: "[CSS Layout & Responsiveness] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CSS layout refactor / responsive grid / container query implementation."
slug: css-layout-script
name: CSS Layout & Responsiveness: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:css-layout, workflow:script, automation, css, layout, frontend
---

# CSS Layout & Responsiveness: Script

[CSS Layout & Responsiveness] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..

## When to use it
Create a reusable automation for "CSS Layout & Responsiveness". The task produces CSS layout refactor / responsive grid / container query implementation. Handle the failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.". Include a dry-run mode and test with Lighthouse mobile emulation + browser DevTools responsive mode.

## Protocol
You are automating a workflow for CSS Layout & Responsiveness. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with CSS layout refactor / responsive grid / container query implementation. Guard against: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Test with Lighthouse mobile emulation + browser DevTools responsive mode.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSS layout refactor / responsive grid / container query implementation this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the CSS Layout & Responsiveness process" — produce a reusable CLI that handles Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.
- "Automate CSS Layout & Responsiveness" — create a dry-run mode and test with Lighthouse mobile emulation.
__USB_SKILL_1F911D2B756B8110__

write_file "$PACK_DIR/skills/csv-data-cleaning-script.md" <<'__USB_SKILL_AE1989C7C25C94EC__'
---
description: "[CSV Data Cleaning Pipeline] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CSV parser / row validator / column type mapper / error report / cleaned output."
slug: csv-data-cleaning-script
name: CSV Data Cleaning Pipeline: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:csv-data-cleaning, workflow:script, automation, data, csv, pipeline
---

# CSV Data Cleaning Pipeline: Script

[CSV Data Cleaning Pipeline] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..

## When to use it
Create a reusable automation for "CSV Data Cleaning Pipeline". The task produces CSV parser / row validator / column type mapper / error report / cleaned output. Handle the failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.". Include a dry-run mode and test with python3 -c csv.DictReader + validation script + row count diff.

## Protocol
You are automating a workflow for CSV Data Cleaning Pipeline. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with CSV parser / row validator / column type mapper / error report / cleaned output. Guard against: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Test with python3 -c csv.DictReader + validation script + row count diff.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the CSV Data Cleaning Pipeline process" — produce a reusable CLI that handles Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.
- "Automate CSV Data Cleaning Pipeline" — create a dry-run mode and test with python3 -c csv.DictReader.
__USB_SKILL_AE1989C7C25C94EC__

write_file "$PACK_DIR/skills/database-migration-safety-script.md" <<'__USB_SKILL_3091FE37A429130D__'
---
description: "[Database Migration Safety] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan."
slug: database-migration-safety-script
name: Database Migration Safety: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:database-migration-safety, workflow:script, automation, database, migration, safety
---

# Database Migration Safety: Script

[Database Migration Safety] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..

## When to use it
Create a reusable automation for "Database Migration Safety". The task produces batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Handle the failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.". Include a dry-run mode and test with pg_locks monitoring during migration + batch backfill script + rollback test.

## Protocol
You are automating a workflow for Database Migration Safety. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Guard against: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Test with pg_locks monitoring during migration + batch backfill script + rollback test.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Database Migration Safety process" — produce a reusable CLI that handles Running a long-running migration (e.
- "Automate Database Migration Safety" — create a dry-run mode and test with pg_locks monitoring during migration.
__USB_SKILL_3091FE37A429130D__

write_file "$PACK_DIR/skills/data-warehouse-schema-script.md" <<'__USB_SKILL_54F5F55E936CE510__'
---
description: "[Data Warehouse Schema Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets star schema / fact table / dimension table / ETL pipeline spec."
slug: data-warehouse-schema-script
name: Data Warehouse Schema Design: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:data-warehouse-schema, workflow:script, automation, data, warehouse, schema
---

# Data Warehouse Schema Design: Script

[Data Warehouse Schema Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..

## When to use it
Create a reusable automation for "Data Warehouse Schema Design". The task produces star schema / fact table / dimension table / ETL pipeline spec. Handle the failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.". Include a dry-run mode and test with dbt run + dbt test + query profiling with warehouse-native tools.

## Protocol
You are automating a workflow for Data Warehouse Schema Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with star schema / fact table / dimension table / ETL pipeline spec. Guard against: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Test with dbt run + dbt test + query profiling with warehouse-native tools.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific star schema / fact table / dimension table / ETL pipeline spec this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Data Warehouse Schema Design process" — produce a reusable CLI that handles Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.
- "Automate Data Warehouse Schema Design" — create a dry-run mode and test with dbt run.
__USB_SKILL_54F5F55E936CE510__

write_file "$PACK_DIR/skills/design-token-system-script.md" <<'__USB_SKILL_04424A75A6AFC38A__'
---
description: "[Design Token Systems] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets token JSON / CSS custom properties / theme switcher / token documentation."
slug: design-token-system-script
name: Design Token Systems: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:design-token-system, workflow:script, automation, design, tokens, components
---

# Design Token Systems: Script

[Design Token Systems] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..

## When to use it
Create a reusable automation for "Design Token Systems". The task produces token JSON / CSS custom properties / theme switcher / token documentation. Handle the failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.". Include a dry-run mode and test with style-dictionary build + Storybook token viewer + token value comparison.

## Protocol
You are automating a workflow for Design Token Systems. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with token JSON / CSS custom properties / theme switcher / token documentation. Guard against: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Test with style-dictionary build + Storybook token viewer + token value comparison.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Design Token Systems process" — produce a reusable CLI that handles Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.
- "Automate Design Token Systems" — create a dry-run mode and test with style-dictionary build.
__USB_SKILL_04424A75A6AFC38A__

write_file "$PACK_DIR/skills/docker-compose-networking-script.md" <<'__USB_SKILL_D5137E3D41BCDB17__'
---
description: "[Docker Compose Networking] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets docker-compose.yml / network config / healthcheck / depends_on condition."
slug: docker-compose-networking-script
name: Docker Compose Networking: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:docker-compose-networking, workflow:script, automation, docker, networking, devops
---

# Docker Compose Networking: Script

[Docker Compose Networking] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..

## When to use it
Create a reusable automation for "Docker Compose Networking". The task produces docker-compose.yml / network config / healthcheck / depends_on condition. Handle the failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.". Include a dry-run mode and test with docker compose up --wait + docker network inspect + container logs.

## Protocol
You are automating a workflow for Docker Compose Networking. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with docker-compose.yml / network config / healthcheck / depends_on condition. Guard against: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Test with docker compose up --wait + docker network inspect + container logs.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Docker Compose Networking process" — produce a reusable CLI that handles Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.
- "Automate Docker Compose Networking" — create a dry-run mode and test with docker compose up --wait.
__USB_SKILL_D5137E3D41BCDB17__

write_file "$PACK_DIR/skills/docker-multistage-script.md" <<'__USB_SKILL_E283A9E75C72A2FB__'
---
description: "[Docker Multi-Stage Builds] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets multi-stage Dockerfile / .dockerignore / slim base image switch."
slug: docker-multistage-script
name: Docker Multi-Stage Builds: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:docker-multistage, workflow:script, automation, docker, build, devops
---

# Docker Multi-Stage Builds: Script

[Docker Multi-Stage Builds] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..

## When to use it
Create a reusable automation for "Docker Multi-Stage Builds". The task produces multi-stage Dockerfile / .dockerignore / slim base image switch. Handle the failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.". Include a dry-run mode and test with docker build + docker scout + dive layer analysis.

## Protocol
You are automating a workflow for Docker Multi-Stage Builds. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with multi-stage Dockerfile / .dockerignore / slim base image switch. Guard against: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Test with docker build + docker scout + dive layer analysis.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Docker Multi-Stage Builds process" — produce a reusable CLI that handles Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.
- "Automate Docker Multi-Stage Builds" — create a dry-run mode and test with docker build.
__USB_SKILL_E283A9E75C72A2FB__

write_file "$PACK_DIR/skills/drizzle-schema-design-script.md" <<'__USB_SKILL_D666741CAA5A59C5__'
---
description: "[Drizzle Schema Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets schema.ts / relation map / migration SQL / Drizzle query builder."
slug: drizzle-schema-design-script
name: Drizzle Schema Design: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:drizzle-schema-design, workflow:script, automation, drizzle, schema, database
---

# Drizzle Schema Design: Script

[Drizzle Schema Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..

## When to use it
Create a reusable automation for "Drizzle Schema Design". The task produces schema.ts / relation map / migration SQL / Drizzle query builder. Handle the failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.". Include a dry-run mode and test with drizzle-kit push + drizzle-kit studio + generated SQL audit.

## Protocol
You are automating a workflow for Drizzle Schema Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with schema.ts / relation map / migration SQL / Drizzle query builder. Guard against: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Test with drizzle-kit push + drizzle-kit studio + generated SQL audit.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Drizzle Schema Design process" — produce a reusable CLI that handles Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.
- "Automate Drizzle Schema Design" — create a dry-run mode and test with drizzle-kit push.
__USB_SKILL_D666741CAA5A59C5__

write_file "$PACK_DIR/skills/error-monitoring-setup-script.md" <<'__USB_SKILL_9F68CA59D535ED4C__'
---
description: "[Error Monitoring & Alerting Setup] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring."
slug: error-monitoring-setup-script
name: Error Monitoring & Alerting Setup: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:error-monitoring-setup, workflow:script, automation, monitoring, errors, alerts
---

# Error Monitoring & Alerting Setup: Script

[Error Monitoring & Alerting Setup] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..

## When to use it
Create a reusable automation for "Error Monitoring & Alerting Setup". The task produces Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Handle the failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.". Include a dry-run mode and test with Sentry API error list + alert rule test + source map validation.

## Protocol
You are automating a workflow for Error Monitoring & Alerting Setup. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Guard against: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Test with Sentry API error list + alert rule test + source map validation.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Error Monitoring & Alerting Setup process" — produce a reusable CLI that handles Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.
- "Automate Error Monitoring & Alerting Setup" — create a dry-run mode and test with Sentry API error list.
__USB_SKILL_9F68CA59D535ED4C__

write_file "$PACK_DIR/skills/fastapi-dependencies-script.md" <<'__USB_SKILL_8CFCA0CF4E1E3880__'
---
description: "[FastAPI Dependency Injection] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets dependency / lifespan handler / override for testing."
slug: fastapi-dependencies-script
name: FastAPI Dependency Injection: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:fastapi-dependencies, workflow:script, automation, fastapi, dependencies, api
---

# FastAPI Dependency Injection: Script

[FastAPI Dependency Injection] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..

## When to use it
Create a reusable automation for "FastAPI Dependency Injection". The task produces dependency / lifespan handler / override for testing. Handle the failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.". Include a dry-run mode and test with uvicorn --reload + /docs interactive test + dependency graph visualisation.

## Protocol
You are automating a workflow for FastAPI Dependency Injection. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with dependency / lifespan handler / override for testing. Guard against: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Test with uvicorn --reload + /docs interactive test + dependency graph visualisation.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific dependency / lifespan handler / override for testing this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the FastAPI Dependency Injection process" — produce a reusable CLI that handles Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.
- "Automate FastAPI Dependency Injection" — create a dry-run mode and test with uvicorn --reload.
__USB_SKILL_8CFCA0CF4E1E3880__

write_file "$PACK_DIR/skills/feature-flags-script.md" <<'__USB_SKILL_AB208F5694D30654__'
---
description: "[Feature Flags & Gradual Rollouts] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag."
slug: feature-flags-script
name: Feature Flags & Gradual Rollouts: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:feature-flags, workflow:script, automation, feature-flags, rollout, devops
---

# Feature Flags & Gradual Rollouts: Script

[Feature Flags & Gradual Rollouts] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..

## When to use it
Create a reusable automation for "Feature Flags & Gradual Rollouts". The task produces flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Handle the failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.". Include a dry-run mode and test with flag evaluation log + rollout percentage monitoring + unused flag scan.

## Protocol
You are automating a workflow for Feature Flags & Gradual Rollouts. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Guard against: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Test with flag evaluation log + rollout percentage monitoring + unused flag scan.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Feature Flags & Gradual Rollouts process" — produce a reusable CLI that handles Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.
- "Automate Feature Flags & Gradual Rollouts" — create a dry-run mode and test with flag evaluation log.
__USB_SKILL_AB208F5694D30654__

write_file "$PACK_DIR/skills/git-conflict-resolution-script.md" <<'__USB_SKILL_A977F9EE821D83C9__'
---
description: "[Git Conflict Resolution] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message."
slug: git-conflict-resolution-script
name: Git Conflict Resolution: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:git-conflict-resolution, workflow:script, automation, git, conflicts, workflow
---

# Git Conflict Resolution: Script

[Git Conflict Resolution] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..

## When to use it
Create a reusable automation for "Git Conflict Resolution". The task produces conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Handle the failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.". Include a dry-run mode and test with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere.

## Protocol
You are automating a workflow for Git Conflict Resolution. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Guard against: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Test with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Git Conflict Resolution process" — produce a reusable CLI that handles Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.
- "Automate Git Conflict Resolution" — create a dry-run mode and test with git log --oneline -5 -- <file>.
__USB_SKILL_A977F9EE821D83C9__

write_file "$PACK_DIR/skills/github-actions-pipeline-script.md" <<'__USB_SKILL_2363D79B17746A60__'
---
description: "[GitHub Actions Pipeline Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets workflow YAML / cache config / matrix build / conditional job execution."
slug: github-actions-pipeline-script
name: GitHub Actions Pipeline Optimisation: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:github-actions-pipeline, workflow:script, automation, github-actions, ci, devops
---

# GitHub Actions Pipeline Optimisation: Script

[GitHub Actions Pipeline Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..

## When to use it
Create a reusable automation for "GitHub Actions Pipeline Optimisation". The task produces workflow YAML / cache config / matrix build / conditional job execution. Handle the failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.". Include a dry-run mode and test with act --job test + cache hit/miss analysis + workflow graph visualisation.

## Protocol
You are automating a workflow for GitHub Actions Pipeline Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with workflow YAML / cache config / matrix build / conditional job execution. Guard against: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Test with act --job test + cache hit/miss analysis + workflow graph visualisation.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific workflow YAML / cache config / matrix build / conditional job execution this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the GitHub Actions Pipeline Optimisation process" — produce a reusable CLI that handles Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.
- "Automate GitHub Actions Pipeline Optimisation" — create a dry-run mode and test with act --job test.
__USB_SKILL_2363D79B17746A60__

write_file "$PACK_DIR/skills/graphql-n-plus-one-script.md" <<'__USB_SKILL_587FD52FEE8592DA__'
---
description: "[GraphQL N+1 Query Prevention] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis."
slug: graphql-n-plus-one-script
name: GraphQL N+1 Query Prevention: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:graphql-n-plus-one, workflow:script, automation, graphql, n-plus-one, performance
---

# GraphQL N+1 Query Prevention: Script

[GraphQL N+1 Query Prevention] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..

## When to use it
Create a reusable automation for "GraphQL N+1 Query Prevention". The task produces DataLoader instance / batch load function / resolver refactor / query complexity analysis. Handle the failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.". Include a dry-run mode and test with graphql query with tracing + DataLoader statistics + SQL log analysis.

## Protocol
You are automating a workflow for GraphQL N+1 Query Prevention. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with DataLoader instance / batch load function / resolver refactor / query complexity analysis. Guard against: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Test with graphql query with tracing + DataLoader statistics + SQL log analysis.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the GraphQL N+1 Query Prevention process" — produce a reusable CLI that handles A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.
- "Automate GraphQL N+1 Query Prevention" — create a dry-run mode and test with graphql query with tracing.
__USB_SKILL_587FD52FEE8592DA__

write_file "$PACK_DIR/skills/jest-test-optimization-script.md" <<'__USB_SKILL_F546B1E734A0496C__'
---
description: "[Jest Test Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking."
slug: jest-test-optimization-script
name: Jest Test Optimisation: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:jest-test-optimization, workflow:script, automation, jest, testing, optimisation
---

# Jest Test Optimisation: Script

[Jest Test Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..

## When to use it
Create a reusable automation for "Jest Test Optimisation". The task produces jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Handle the failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes.". Include a dry-run mode and test with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check.

## Protocol
You are automating a workflow for Jest Test Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Guard against: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Test with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Jest Test Optimisation process" — produce a reusable CLI that handles Running the entire test suite on every change, taking minutes even for small incremental code changes.
- "Automate Jest Test Optimisation" — create a dry-run mode and test with jest --changedSince=main --json.
__USB_SKILL_F546B1E734A0496C__

write_file "$PACK_DIR/skills/json-schema-validation-script.md" <<'__USB_SKILL_BC11A2167D6A7FA4__'
---
description: "[JSON Schema Validation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets JSON Schema / validator middleware / type guard / error message / response parser."
slug: json-schema-validation-script
name: JSON Schema Validation: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:json-schema-validation, workflow:script, automation, json, validation, api
---

# JSON Schema Validation: Script

[JSON Schema Validation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..

## When to use it
Create a reusable automation for "JSON Schema Validation". The task produces JSON Schema / validator middleware / type guard / error message / response parser. Handle the failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.". Include a dry-run mode and test with ajv validate + JSON Schema test suite + response mock test.

## Protocol
You are automating a workflow for JSON Schema Validation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with JSON Schema / validator middleware / type guard / error message / response parser. Guard against: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Test with ajv validate + JSON Schema test suite + response mock test.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the JSON Schema Validation process" — produce a reusable CLI that handles Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.
- "Automate JSON Schema Validation" — create a dry-run mode and test with ajv validate.
__USB_SKILL_BC11A2167D6A7FA4__

write_file "$PACK_DIR/skills/kubernetes-hpa-script.md" <<'__USB_SKILL_01FE1C601173F834__'
---
description: "[Kubernetes Horizontal Pod Autoscaling] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config."
slug: kubernetes-hpa-script
name: Kubernetes Horizontal Pod Autoscaling: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-hpa, workflow:script, automation, kubernetes, autoscaling, devops
---

# Kubernetes Horizontal Pod Autoscaling: Script

[Kubernetes Horizontal Pod Autoscaling] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..

## When to use it
Create a reusable automation for "Kubernetes Horizontal Pod Autoscaling". The task produces HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Handle the failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.". Include a dry-run mode and test with kubectl get hpa --watch + kubectl top pods + metrics-server logs.

## Protocol
You are automating a workflow for Kubernetes Horizontal Pod Autoscaling. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Guard against: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Test with kubectl get hpa --watch + kubectl top pods + metrics-server logs.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Kubernetes Horizontal Pod Autoscaling process" — produce a reusable CLI that handles HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.
- "Automate Kubernetes Horizontal Pod Autoscaling" — create a dry-run mode and test with kubectl get hpa --watch.
__USB_SKILL_01FE1C601173F834__

write_file "$PACK_DIR/skills/kubernetes-pod-lifecycle-script.md" <<'__USB_SKILL_9A89FA3DF54E55B8__'
---
description: "[Kubernetes Pod Lifecycle] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container."
slug: kubernetes-pod-lifecycle-script
name: Kubernetes Pod Lifecycle: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-pod-lifecycle, workflow:script, automation, kubernetes, pods, devops
---

# Kubernetes Pod Lifecycle: Script

[Kubernetes Pod Lifecycle] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..

## When to use it
Create a reusable automation for "Kubernetes Pod Lifecycle". The task produces deployment.yaml / startup probe / readiness probe / liveness probe / init container. Handle the failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.". Include a dry-run mode and test with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'.

## Protocol
You are automating a workflow for Kubernetes Pod Lifecycle. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with deployment.yaml / startup probe / readiness probe / liveness probe / init container. Guard against: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Test with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Kubernetes Pod Lifecycle process" — produce a reusable CLI that handles Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.
- "Automate Kubernetes Pod Lifecycle" — create a dry-run mode and test with kubectl describe pod.
__USB_SKILL_9A89FA3DF54E55B8__

write_file "$PACK_DIR/skills/context-window-budget-script.md" <<'__USB_SKILL_7B8DE71AABC24180__'
---
description: "[LLM Context Window Budget Management] Create a reusable automation with idempotency, dry-run mode, and verification Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard."
slug: context-window-budget-script
name: LLM Context Window Budget Management: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:context-window-budget, workflow:script, automation, context, tokens, llm, memory, summarization
---

# LLM Context Window Budget Management: Script

[LLM Context Window Budget Management] Create a reusable automation with idempotency, dry-run mode, and verification Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..

## When to use it
Create a reusable automation for "LLM Context Window Budget Management". The task produces trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Handle the failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.". Include a dry-run mode and test with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry.

## Protocol
You are automating a workflow for LLM Context Window Budget Management. Create a reusable automation with idempotency, dry-run mode, and verification. The automation should produce or interact with trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Guard against: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Test with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves.

## Output contract
- **md** (markdown): MD output
- **cmd** (command): CMD output

## Examples
- "Script the LLM Context Window Budget Management process" — produce a reusable CLI that handles Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content.
- "Automate LLM Context Window Budget Management" — create a dry-run mode and test with tiktoken count.
__USB_SKILL_7B8DE71AABC24180__

write_file "$PACK_DIR/skills/mcp-tool-design-script.md" <<'__USB_SKILL_061E6EE3D2E94AD4__'
---
description: "[MCP Tool Design & Best Practices] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets MCP tool descriptor / resource definition / prompt template / server metadata."
slug: mcp-tool-design-script
name: MCP Tool Design & Best Practices: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:mcp-tool-design, workflow:script, automation, mcp, tools, agents
---

# MCP Tool Design & Best Practices: Script

[MCP Tool Design & Best Practices] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..

## When to use it
Create a reusable automation for "MCP Tool Design & Best Practices". The task produces MCP tool descriptor / resource definition / prompt template / server metadata. Handle the failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.". Include a dry-run mode and test with mcp-cli run + mcp inspector + tool name conflict analysis.

## Protocol
You are automating a workflow for MCP Tool Design & Best Practices. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with MCP tool descriptor / resource definition / prompt template / server metadata. Guard against: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Test with mcp-cli run + mcp inspector + tool name conflict analysis.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the MCP Tool Design & Best Practices process" — produce a reusable CLI that handles Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.
- "Automate MCP Tool Design & Best Practices" — create a dry-run mode and test with mcp-cli run.
__USB_SKILL_061E6EE3D2E94AD4__

write_file "$PACK_DIR/skills/message-queues-script.md" <<'__USB_SKILL_2827FEB5CDE11053__'
---
description: "[Message Queues & Background Jobs] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets queue producer / worker / dead-letter handler / retry policy."
slug: message-queues-script
name: Message Queues & Background Jobs: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:message-queues, workflow:script, automation, queue, background-jobs, backend
---

# Message Queues & Background Jobs: Script

[Message Queues & Background Jobs] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..

## When to use it
Create a reusable automation for "Message Queues & Background Jobs". The task produces queue producer / worker / dead-letter handler / retry policy. Handle the failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.". Include a dry-run mode and test with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection.

## Protocol
You are automating a workflow for Message Queues & Background Jobs. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with queue producer / worker / dead-letter handler / retry policy. Guard against: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Test with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific queue producer / worker / dead-letter handler / retry policy this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Message Queues & Background Jobs process" — produce a reusable CLI that handles Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.
- "Automate Message Queues & Background Jobs" — create a dry-run mode and test with Bull/BullMQ dashboard.
__USB_SKILL_2827FEB5CDE11053__

write_file "$PACK_DIR/skills/multi-tenant-isolation-script.md" <<'__USB_SKILL_F4E06E111677A82E__'
---
description: "[Multi-Tenant Data Isolation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder."
slug: multi-tenant-isolation-script
name: Multi-Tenant Data Isolation: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:multi-tenant-isolation, workflow:script, automation, multi-tenant, saas, database
---

# Multi-Tenant Data Isolation: Script

[Multi-Tenant Data Isolation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..

## When to use it
Create a reusable automation for "Multi-Tenant Data Isolation". The task produces RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Handle the failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.". Include a dry-run mode and test with RLS policy test with two different tenant sessions + data leakage check.

## Protocol
You are automating a workflow for Multi-Tenant Data Isolation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Guard against: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Test with RLS policy test with two different tenant sessions + data leakage check.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Multi-Tenant Data Isolation process" — produce a reusable CLI that handles Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.
- "Automate Multi-Tenant Data Isolation" — create a dry-run mode and test with RLS policy test with two different tenant sessions.
__USB_SKILL_F4E06E111677A82E__

write_file "$PACK_DIR/skills/nextjs-api-routes-script.md" <<'__USB_SKILL_C09C1619ADC1E0BB__'
---
description: "[Next.js API Routes & Route Handlers] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets route.ts handler / server action / API client wrapper / error boundary."
slug: nextjs-api-routes-script
name: Next.js API Routes & Route Handlers: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-api-routes, workflow:script, automation, nextjs, api, backend
---

# Next.js API Routes & Route Handlers: Script

[Next.js API Routes & Route Handlers] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..

## When to use it
Create a reusable automation for "Next.js API Routes & Route Handlers". The task produces route.ts handler / server action / API client wrapper / error boundary. Handle the failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.". Include a dry-run mode and test with curl --verbose + API route error log + status code audit.

## Protocol
You are automating a workflow for Next.js API Routes & Route Handlers. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with route.ts handler / server action / API client wrapper / error boundary. Guard against: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Test with curl --verbose + API route error log + status code audit.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific route.ts handler / server action / API client wrapper / error boundary this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Next.js API Routes & Route Handlers process" — produce a reusable CLI that handles Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.
- "Automate Next.js API Routes & Route Handlers" — create a dry-run mode and test with curl --verbose.
__USB_SKILL_C09C1619ADC1E0BB__

write_file "$PACK_DIR/skills/nextjs-data-fetching-script.md" <<'__USB_SKILL_686843D1E6F6DD9D__'
---
description: "[Next.js Data Fetching Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets server fetch / React cache wrapper / streaming suspense boundary."
slug: nextjs-data-fetching-script
name: Next.js Data Fetching Patterns: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-data-fetching, workflow:script, automation, nextjs, data-fetching, fullstack
---

# Next.js Data Fetching Patterns: Script

[Next.js Data Fetching Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..

## When to use it
Create a reusable automation for "Next.js Data Fetching Patterns". The task produces server fetch / React cache wrapper / streaming suspense boundary. Handle the failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.". Include a dry-run mode and test with next build --debug + React DevTools fetch profiling.

## Protocol
You are automating a workflow for Next.js Data Fetching Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with server fetch / React cache wrapper / streaming suspense boundary. Guard against: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Test with next build --debug + React DevTools fetch profiling.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server fetch / React cache wrapper / streaming suspense boundary this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Next.js Data Fetching Patterns process" — produce a reusable CLI that handles Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.
- "Automate Next.js Data Fetching Patterns" — create a dry-run mode and test with next build --debug.
__USB_SKILL_686843D1E6F6DD9D__

write_file "$PACK_DIR/skills/nextjs-middleware-script.md" <<'__USB_SKILL_A097B432D7F4C36E__'
---
description: "[Next.js Middleware & Edge Runtime] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing."
slug: nextjs-middleware-script
name: Next.js Middleware & Edge Runtime: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-middleware, workflow:script, automation, nextjs, middleware, edge
---

# Next.js Middleware & Edge Runtime: Script

[Next.js Middleware & Edge Runtime] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..

## When to use it
Create a reusable automation for "Next.js Middleware & Edge Runtime". The task produces middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Handle the failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.". Include a dry-run mode and test with next dev + curl --cookie tests + edge runtime log inspection.

## Protocol
You are automating a workflow for Next.js Middleware & Edge Runtime. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Guard against: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Test with next dev + curl --cookie tests + edge runtime log inspection.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Next.js Middleware & Edge Runtime process" — produce a reusable CLI that handles Using Node.
- "Automate Next.js Middleware & Edge Runtime" — create a dry-run mode and test with next dev.
__USB_SKILL_A097B432D7F4C36E__

write_file "$PACK_DIR/skills/node-error-handling-script.md" <<'__USB_SKILL_349B1F852BEEA6D2__'
---
description: "[Node.js Error Handling & Resilience] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets global error handler / async wrapper / structured error response / retry logic."
slug: node-error-handling-script
name: Node.js Error Handling & Resilience: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:node-error-handling, workflow:script, automation, node, error-handling, backend
---

# Node.js Error Handling & Resilience: Script

[Node.js Error Handling & Resilience] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..

## When to use it
Create a reusable automation for "Node.js Error Handling & Resilience". The task produces global error handler / async wrapper / structured error response / retry logic. Handle the failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.". Include a dry-run mode and test with node --unhandled-rejections=strict + process.on('uncaughtException') log.

## Protocol
You are automating a workflow for Node.js Error Handling & Resilience. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with global error handler / async wrapper / structured error response / retry logic. Guard against: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Test with node --unhandled-rejections=strict + process.on('uncaughtException') log.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific global error handler / async wrapper / structured error response / retry logic this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Node.js Error Handling & Resilience process" — produce a reusable CLI that handles Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.
- "Automate Node.js Error Handling & Resilience" — create a dry-run mode and test with node --unhandled-rejections=strict.
__USB_SKILL_349B1F852BEEA6D2__

write_file "$PACK_DIR/skills/node-streams-script.md" <<'__USB_SKILL_027AADAD4F6CF726__'
---
description: "[Node.js Streams & Backpressure] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Readable/Writable stream / Transform / pipeline() refactor."
slug: node-streams-script
name: Node.js Streams & Backpressure: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:node-streams, workflow:script, automation, node, streams, performance
---

# Node.js Streams & Backpressure: Script

[Node.js Streams & Backpressure] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..

## When to use it
Create a reusable automation for "Node.js Streams & Backpressure". The task produces Readable/Writable stream / Transform / pipeline() refactor. Handle the failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.". Include a dry-run mode and test with Node.js --inspect memory heap snapshot + stream highWaterMark tuning.

## Protocol
You are automating a workflow for Node.js Streams & Backpressure. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with Readable/Writable stream / Transform / pipeline() refactor. Guard against: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Test with Node.js --inspect memory heap snapshot + stream highWaterMark tuning.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Readable/Writable stream / Transform / pipeline() refactor this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Node.js Streams & Backpressure process" — produce a reusable CLI that handles Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.
- "Automate Node.js Streams & Backpressure" — create a dry-run mode and test with Node.js --inspect memory heap snapshot.
__USB_SKILL_027AADAD4F6CF726__

write_file "$PACK_DIR/skills/oauth-flows-script.md" <<'__USB_SKILL_54126DAA8B147444__'
---
description: "[OAuth 2.0 Flows & Token Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler."
slug: oauth-flows-script
name: OAuth 2.0 Flows & Token Management: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:oauth-flows, workflow:script, automation, oauth, auth, security
---

# OAuth 2.0 Flows & Token Management: Script

[OAuth 2.0 Flows & Token Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..

## When to use it
Create a reusable automation for "OAuth 2.0 Flows & Token Management". The task produces OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Handle the failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.". Include a dry-run mode and test with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection.

## Protocol
You are automating a workflow for OAuth 2.0 Flows & Token Management. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Guard against: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Test with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the OAuth 2.0 Flows & Token Management process" — produce a reusable CLI that handles Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.
- "Automate OAuth 2.0 Flows & Token Management" — create a dry-run mode and test with oauth2_proxy.
__USB_SKILL_54126DAA8B147444__

write_file "$PACK_DIR/skills/openapi-spec-script.md" <<'__USB_SKILL_F4342B2210456A13__'
---
description: "[OpenAPI Specification & Validation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets openapi.yaml / code-first generator / request/response validation middleware."
slug: openapi-spec-script
name: OpenAPI Specification & Validation: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:openapi-spec, workflow:script, automation, openapi, api, contract
---

# OpenAPI Specification & Validation: Script

[OpenAPI Specification & Validation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..

## When to use it
Create a reusable automation for "OpenAPI Specification & Validation". The task produces openapi.yaml / code-first generator / request/response validation middleware. Handle the failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.". Include a dry-run mode and test with redocly lint + openapi-diff + swagger-ui preview.

## Protocol
You are automating a workflow for OpenAPI Specification & Validation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with openapi.yaml / code-first generator / request/response validation middleware. Guard against: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Test with redocly lint + openapi-diff + swagger-ui preview.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific openapi.yaml / code-first generator / request/response validation middleware this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the OpenAPI Specification & Validation process" — produce a reusable CLI that handles Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.
- "Automate OpenAPI Specification & Validation" — create a dry-run mode and test with redocly lint.
__USB_SKILL_F4342B2210456A13__

write_file "$PACK_DIR/skills/playwright-selectors-script.md" <<'__USB_SKILL_045E3334DE7F6314__'
---
description: "[Playwright Selectors & Locators] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture."
slug: playwright-selectors-script
name: Playwright Selectors & Locators: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:playwright-selectors, workflow:script, automation, playwright, testing, e2e
---

# Playwright Selectors & Locators: Script

[Playwright Selectors & Locators] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..

## When to use it
Create a reusable automation for "Playwright Selectors & Locators". The task produces locator refactor / test fixture / POM (Page Object Model) / custom fixture. Handle the failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.". Include a dry-run mode and test with playwright test --reporter=html + playwright codegen + trace viewer.

## Protocol
You are automating a workflow for Playwright Selectors & Locators. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with locator refactor / test fixture / POM (Page Object Model) / custom fixture. Guard against: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Test with playwright test --reporter=html + playwright codegen + trace viewer.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Playwright Selectors & Locators process" — produce a reusable CLI that handles Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.
- "Automate Playwright Selectors & Locators" — create a dry-run mode and test with playwright test --reporter=html.
__USB_SKILL_045E3334DE7F6314__

write_file "$PACK_DIR/skills/prompt-injection-defense-script.md" <<'__USB_SKILL_9307C91117F4DB8F__'
---
description: "[Prompt Injection Defense] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator."
slug: prompt-injection-defense-script
name: Prompt Injection Defense: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:prompt-injection-defense, workflow:script, automation, prompt, security, llm
---

# Prompt Injection Defense: Script

[Prompt Injection Defense] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..

## When to use it
Create a reusable automation for "Prompt Injection Defense". The task produces defensive system prompt / input sanitizer / instruction guardrail / output validator. Handle the failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.". Include a dry-run mode and test with prompt injection test suite + adversarial input fuzzing + output scanner.

## Protocol
You are automating a workflow for Prompt Injection Defense. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with defensive system prompt / input sanitizer / instruction guardrail / output validator. Guard against: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Test with prompt injection test suite + adversarial input fuzzing + output scanner.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Prompt Injection Defense process" — produce a reusable CLI that handles Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.
- "Automate Prompt Injection Defense" — create a dry-run mode and test with prompt injection test suite.
__USB_SKILL_9307C91117F4DB8F__

write_file "$PACK_DIR/skills/python-async-script.md" <<'__USB_SKILL_5737AA9183FDD582__'
---
description: "[Python Async/Await Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets async/await refactor / asyncio.gather / async context manager."
slug: python-async-script
name: Python Async/Await Patterns: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:python-async, workflow:script, automation, python, async, performance
---

# Python Async/Await Patterns: Script

[Python Async/Await Patterns] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..

## When to use it
Create a reusable automation for "Python Async/Await Patterns". The task produces async/await refactor / asyncio.gather / async context manager. Handle the failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions.". Include a dry-run mode and test with python3 -m asyncio + aiohttp/httpx async benchmark.

## Protocol
You are automating a workflow for Python Async/Await Patterns. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with async/await refactor / asyncio.gather / async context manager. Guard against: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Test with python3 -m asyncio + aiohttp/httpx async benchmark.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific async/await refactor / asyncio.gather / async context manager this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Python Async/Await Patterns process" — produce a reusable CLI that handles Blocking the event loop by using synchronous requests or time.
- "Automate Python Async/Await Patterns" — create a dry-run mode and test with python3 -m asyncio.
__USB_SKILL_5737AA9183FDD582__

write_file "$PACK_DIR/skills/python-file-io-script.md" <<'__USB_SKILL_9C67088E3FCB8B03__'
---
description: "[Python File I/O & Encoding] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets pathlib refactor / encoding-safe file reader / batch file processor."
slug: python-file-io-script
name: Python File I/O & Encoding: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:python-file-io, workflow:script, automation, python, file-io, scripting
---

# Python File I/O & Encoding: Script

[Python File I/O & Encoding] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..

## When to use it
Create a reusable automation for "Python File I/O & Encoding". The task produces pathlib refactor / encoding-safe file reader / batch file processor. Handle the failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.". Include a dry-run mode and test with python3 -c with open() + chardet encoding detection.

## Protocol
You are automating a workflow for Python File I/O & Encoding. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with pathlib refactor / encoding-safe file reader / batch file processor. Guard against: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Test with python3 -c with open() + chardet encoding detection.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Python File I/O & Encoding process" — produce a reusable CLI that handles Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.
- "Automate Python File I/O & Encoding" — create a dry-run mode and test with python3 -c with open().
__USB_SKILL_9C67088E3FCB8B03__

write_file "$PACK_DIR/skills/rag-chunking-script.md" <<'__USB_SKILL_EE201BB74B344A6D__'
---
description: "[RAG Chunking Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment."
slug: rag-chunking-script
name: RAG Chunking Strategies: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rag-chunking, workflow:script, automation, rag, chunking, retrieval
---

# RAG Chunking Strategies: Script

[RAG Chunking Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..

## When to use it
Create a reusable automation for "RAG Chunking Strategies". The task produces semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Handle the failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.". Include a dry-run mode and test with retrieval evaluation script + chunk boundary visualisation + recall@k measurement.

## Protocol
You are automating a workflow for RAG Chunking Strategies. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Guard against: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Test with retrieval evaluation script + chunk boundary visualisation + recall@k measurement.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the RAG Chunking Strategies process" — produce a reusable CLI that handles Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.
- "Automate RAG Chunking Strategies" — create a dry-run mode and test with retrieval evaluation script.
__USB_SKILL_EE201BB74B344A6D__

write_file "$PACK_DIR/skills/rate-limiting-proxy-script.md" <<'__USB_SKILL_B99AB6F4D868D291__'
---
description: "[Rate Limiting & API Gateway Proxy] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation."
slug: rate-limiting-proxy-script
name: Rate Limiting & API Gateway Proxy: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rate-limiting-proxy, workflow:script, automation, rate-limiting, proxy, security
---

# Rate Limiting & API Gateway Proxy: Script

[Rate Limiting & API Gateway Proxy] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..

## When to use it
Create a reusable automation for "Rate Limiting & API Gateway Proxy". The task produces NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Handle the failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.". Include a dry-run mode and test with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring.

## Protocol
You are automating a workflow for Rate Limiting & API Gateway Proxy. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Guard against: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Test with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Rate Limiting & API Gateway Proxy process" — produce a reusable CLI that handles Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.
- "Automate Rate Limiting & API Gateway Proxy" — create a dry-run mode and test with ab -n 1000 -c 10.
__USB_SKILL_B99AB6F4D868D291__

write_file "$PACK_DIR/skills/react-server-components-script.md" <<'__USB_SKILL_71FC785351116474__'
---
description: "[React Server Components] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets server component / client boundary refactor / streaming fallback."
slug: react-server-components-script
name: React Server Components: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:react-server-components, workflow:script, automation, react, rsc, frontend
---

# React Server Components: Script

[React Server Components] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..

## When to use it
Create a reusable automation for "React Server Components". The task produces server component / client boundary refactor / streaming fallback. Handle the failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file.". Include a dry-run mode and test with next build --debug + React Server Components lint rule.

## Protocol
You are automating a workflow for React Server Components. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with server component / client boundary refactor / streaming fallback. Guard against: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Test with next build --debug + React Server Components lint rule.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server component / client boundary refactor / streaming fallback this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the React Server Components process" — produce a reusable CLI that handles Accidentally making a server component a client component by using hooks or event handlers in the wrong file.
- "Automate React Server Components" — create a dry-run mode and test with next build --debug.
__USB_SKILL_71FC785351116474__

write_file "$PACK_DIR/skills/react-state-script.md" <<'__USB_SKILL_58CAD2E124049097__'
---
description: "[React State Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice."
slug: react-state-script
name: React State Management: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:react-state, workflow:script, automation, react, state, frontend
---

# React State Management: Script

[React State Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..

## When to use it
Create a reusable automation for "React State Management". The task produces useState / useReducer / useContext hook refactor, zustand or jotai store slice. Handle the failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.". Include a dry-run mode and test with React DevTools profiler + why-did-you-render.

## Protocol
You are automating a workflow for React State Management. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with useState / useReducer / useContext hook refactor, zustand or jotai store slice. Guard against: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Test with React DevTools profiler + why-did-you-render.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the React State Management process" — produce a reusable CLI that handles Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.
- "Automate React State Management" — create a dry-run mode and test with React DevTools profiler.
__USB_SKILL_58CAD2E124049097__

write_file "$PACK_DIR/skills/redis-caching-script.md" <<'__USB_SKILL_5CE47F4DF8A0EF53__'
---
description: "[Redis Caching Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy."
slug: redis-caching-script
name: Redis Caching Strategies: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:redis-caching, workflow:script, automation, redis, caching, performance
---

# Redis Caching Strategies: Script

[Redis Caching Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..

## When to use it
Create a reusable automation for "Redis Caching Strategies". The task produces cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Handle the failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.". Include a dry-run mode and test with redis-cli --stat + cache hit ratio monitoring + slow log.

## Protocol
You are automating a workflow for Redis Caching Strategies. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Guard against: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Test with redis-cli --stat + cache hit ratio monitoring + slow log.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Redis Caching Strategies process" — produce a reusable CLI that handles Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.
- "Automate Redis Caching Strategies" — create a dry-run mode and test with redis-cli --stat.
__USB_SKILL_5CE47F4DF8A0EF53__

write_file "$PACK_DIR/skills/rest-pagination-script.md" <<'__USB_SKILL_5872C2FEB58061CF__'
---
description: "[REST Pagination Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope."
slug: rest-pagination-script
name: REST Pagination Design: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rest-pagination, workflow:script, automation, rest, pagination, api
---

# REST Pagination Design: Script

[REST Pagination Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..

## When to use it
Create a reusable automation for "REST Pagination Design". The task produces cursor pagination / offset pagination fallback / total count optimisation / response envelope. Handle the failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.". Include a dry-run mode and test with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark.

## Protocol
You are automating a workflow for REST Pagination Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with cursor pagination / offset pagination fallback / total count optimisation / response envelope. Guard against: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Test with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the REST Pagination Design process" — produce a reusable CLI that handles Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.
- "Automate REST Pagination Design" — create a dry-run mode and test with curl with cursor param.
__USB_SKILL_5872C2FEB58061CF__

write_file "$PACK_DIR/skills/secrets-rotation-script.md" <<'__USB_SKILL_99E567A58EBDE6BA__'
---
description: "[Secrets Rotation Policy] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets rotation script / vault integration / lease management / incident response plan."
slug: secrets-rotation-script
name: Secrets Rotation Policy: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:secrets-rotation, workflow:script, automation, secrets, security, rotation
---

# Secrets Rotation Policy: Script

[Secrets Rotation Policy] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..

## When to use it
Create a reusable automation for "Secrets Rotation Policy". The task produces rotation script / vault integration / lease management / incident response plan. Handle the failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.". Include a dry-run mode and test with vault lease list + secret expiry check + rotation dry-run test.

## Protocol
You are automating a workflow for Secrets Rotation Policy. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with rotation script / vault integration / lease management / incident response plan. Guard against: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Test with vault lease list + secret expiry check + rotation dry-run test.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific rotation script / vault integration / lease management / incident response plan this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Secrets Rotation Policy process" — produce a reusable CLI that handles Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.
- "Automate Secrets Rotation Policy" — create a dry-run mode and test with vault lease list.
__USB_SKILL_99E567A58EBDE6BA__

write_file "$PACK_DIR/skills/shell-script-robustness-script.md" <<'__USB_SKILL_354DDA87AB4A8FDC__'
---
description: "[Shell Script Robustness & Safety] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function."
slug: shell-script-robustness-script
name: Shell Script Robustness & Safety: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:shell-script-robustness, workflow:script, automation, shell, scripting, safety
---

# Shell Script Robustness & Safety: Script

[Shell Script Robustness & Safety] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..

## When to use it
Create a reusable automation for "Shell Script Robustness & Safety". The task produces set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Handle the failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.". Include a dry-run mode and test with shellcheck script.sh + bash -n script.sh + dry-run mode test.

## Protocol
You are automating a workflow for Shell Script Robustness & Safety. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Guard against: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Test with shellcheck script.sh + bash -n script.sh + dry-run mode test.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Shell Script Robustness & Safety process" — produce a reusable CLI that handles Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.
- "Automate Shell Script Robustness & Safety" — create a dry-run mode and test with shellcheck script.sh.
__USB_SKILL_354DDA87AB4A8FDC__

write_file "$PACK_DIR/skills/sql-query-optimization-script.md" <<'__USB_SKILL_5C46D1E9E841F769__'
---
description: "[SQL Query Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index."
slug: sql-query-optimization-script
name: SQL Query Optimisation: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:sql-query-optimization, workflow:script, automation, sql, optimization, database
---

# SQL Query Optimisation: Script

[SQL Query Optimisation] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..

## When to use it
Create a reusable automation for "SQL Query Optimisation". The task produces indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Handle the failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.". Include a dry-run mode and test with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query.

## Protocol
You are automating a workflow for SQL Query Optimisation. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Guard against: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Test with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the SQL Query Optimisation process" — produce a reusable CLI that handles Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.
- "Automate SQL Query Optimisation" — create a dry-run mode and test with EXPLAIN (ANALYSE, BUFFERS).
__USB_SKILL_5C46D1E9E841F769__

write_file "$PACK_DIR/skills/stealth-web-research-script.md" <<'__USB_SKILL_EC79A6361AD66923__'
---
description: "[Stealth Web Research & Harvesting] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages."
slug: stealth-web-research-script
name: Stealth Web Research & Harvesting: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:stealth-web-research, workflow:script, automation, stealth, scraping, research, anti-bot
---

# Stealth Web Research & Harvesting: Script

[Stealth Web Research & Harvesting] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..

## When to use it
Create a reusable automation for "Stealth Web Research & Harvesting". The task produces clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Handle the failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.". Include a dry-run mode and test with playwright-extra + stealth + cheerio + defuddle + manual jq inspection.

## Protocol
You are automating a workflow for Stealth Web Research & Harvesting. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Guard against: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Test with playwright-extra + stealth + cheerio + defuddle + manual jq inspection.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Stealth Web Research & Harvesting process" — produce a reusable CLI that handles Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.
- "Automate Stealth Web Research & Harvesting" — create a dry-run mode and test with playwright-extra.
__USB_SKILL_EC79A6361AD66923__

write_file "$PACK_DIR/skills/stripe-webhook-idempotency-script.md" <<'__USB_SKILL_8F234524A7C55115__'
---
description: "[Stripe Webhook Idempotency] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery."
slug: stripe-webhook-idempotency-script
name: Stripe Webhook Idempotency: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:stripe-webhook-idempotency, workflow:script, automation, stripe, webhook, payments
---

# Stripe Webhook Idempotency: Script

[Stripe Webhook Idempotency] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..

## When to use it
Create a reusable automation for "Stripe Webhook Idempotency". The task produces Webhook handler / idempotency key check / event deduplication / failed payment recovery. Handle the failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.". Include a dry-run mode and test with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check.

## Protocol
You are automating a workflow for Stripe Webhook Idempotency. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with Webhook handler / idempotency key check / event deduplication / failed payment recovery. Guard against: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Test with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Stripe Webhook Idempotency process" — produce a reusable CLI that handles Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.
- "Automate Stripe Webhook Idempotency" — create a dry-run mode and test with stripe trigger payment_intent.succeeded.
__USB_SKILL_8F234524A7C55115__

write_file "$PACK_DIR/skills/supabase-rls-script.md" <<'__USB_SKILL_8649D160850AF4DA__'
---
description: "[Supabase Row-Level Security] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets RLS policy / policy test / security definer function / admin bypass."
slug: supabase-rls-script
name: Supabase Row-Level Security: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:supabase-rls, workflow:script, automation, supabase, rls, security
---

# Supabase Row-Level Security: Script

[Supabase Row-Level Security] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..

## When to use it
Create a reusable automation for "Supabase Row-Level Security". The task produces RLS policy / policy test / security definer function / admin bypass. Handle the failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.". Include a dry-run mode and test with supabase db check + supabase db test + RLS policy review with pg_policies.

## Protocol
You are automating a workflow for Supabase Row-Level Security. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with RLS policy / policy test / security definer function / admin bypass. Guard against: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Test with supabase db check + supabase db test + RLS policy review with pg_policies.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / policy test / security definer function / admin bypass this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Supabase Row-Level Security process" — produce a reusable CLI that handles RLS policies that are too permissive (using 'true' instead of 'auth.
- "Automate Supabase Row-Level Security" — create a dry-run mode and test with supabase db check.
__USB_SKILL_8649D160850AF4DA__

write_file "$PACK_DIR/skills/terraform-state-script.md" <<'__USB_SKILL_78C6E87675A8265C__'
---
description: "[Terraform State Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets backend config / state migration plan / state locking config / remote state datasource."
slug: terraform-state-script
name: Terraform State Management: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:terraform-state, workflow:script, automation, terraform, state, iac
---

# Terraform State Management: Script

[Terraform State Management] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..

## When to use it
Create a reusable automation for "Terraform State Management". The task produces backend config / state migration plan / state locking config / remote state datasource. Handle the failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.". Include a dry-run mode and test with terraform plan + terraform state list + terraform state pull | jq.

## Protocol
You are automating a workflow for Terraform State Management. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with backend config / state migration plan / state locking config / remote state datasource. Guard against: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Test with terraform plan + terraform state list + terraform state pull | jq.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific backend config / state migration plan / state locking config / remote state datasource this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Terraform State Management process" — produce a reusable CLI that handles Losing the .
- "Automate Terraform State Management" — create a dry-run mode and test with terraform plan.
__USB_SKILL_78C6E87675A8265C__

write_file "$PACK_DIR/skills/typescript-generics-script.md" <<'__USB_SKILL_CBB134808D11F7EB__'
---
description: "[TypeScript Generics & Advanced Types] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets generic type / conditional type / mapped type / branded type."
slug: typescript-generics-script
name: TypeScript Generics & Advanced Types: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:typescript-generics, workflow:script, automation, typescript, generics, type-system
---

# TypeScript Generics & Advanced Types: Script

[TypeScript Generics & Advanced Types] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..

## When to use it
Create a reusable automation for "TypeScript Generics & Advanced Types". The task produces generic type / conditional type / mapped type / branded type. Handle the failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).". Include a dry-run mode and test with tsc --noEmit --strict + type tests with expect-type.

## Protocol
You are automating a workflow for TypeScript Generics & Advanced Types. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with generic type / conditional type / mapped type / branded type. Guard against: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Test with tsc --noEmit --strict + type tests with expect-type.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific generic type / conditional type / mapped type / branded type this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the TypeScript Generics & Advanced Types process" — produce a reusable CLI that handles Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).
- "Automate TypeScript Generics & Advanced Types" — create a dry-run mode and test with tsc --noEmit --strict.
__USB_SKILL_CBB134808D11F7EB__

write_file "$PACK_DIR/skills/user-onboarding-flow-script.md" <<'__USB_SKILL_803D3BB858B065AF__'
---
description: "[User Onboarding Flow Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec."
slug: user-onboarding-flow-script
name: User Onboarding Flow Design: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:user-onboarding-flow, workflow:script, automation, ux, onboarding, product
---

# User Onboarding Flow Design: Script

[User Onboarding Flow Design] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..

## When to use it
Create a reusable automation for "User Onboarding Flow Design". The task produces onboarding wizard / feature checklist / in-app guide / first-run experience spec. Handle the failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.". Include a dry-run mode and test with analytics funnel analysis + onboarding completion rate + drop-off heatmap.

## Protocol
You are automating a workflow for User Onboarding Flow Design. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with onboarding wizard / feature checklist / in-app guide / first-run experience spec. Guard against: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Test with analytics funnel analysis + onboarding completion rate + drop-off heatmap.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the User Onboarding Flow Design process" — produce a reusable CLI that handles Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.
- "Automate User Onboarding Flow Design" — create a dry-run mode and test with analytics funnel analysis.
__USB_SKILL_803D3BB858B065AF__

write_file "$PACK_DIR/skills/vercel-env-vars-script.md" <<'__USB_SKILL_192C520383481084__'
---
description: "[Vercel Environment Variables] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets vercel.json env group / preview env config / Edge Config / KV store."
slug: vercel-env-vars-script
name: Vercel Environment Variables: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:vercel-env-vars, workflow:script, automation, vercel, env, deployment
---

# Vercel Environment Variables: Script

[Vercel Environment Variables] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..

## When to use it
Create a reusable automation for "Vercel Environment Variables". The task produces vercel.json env group / preview env config / Edge Config / KV store. Handle the failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.". Include a dry-run mode and test with vercel env pull + vercel list + project settings audit.

## Protocol
You are automating a workflow for Vercel Environment Variables. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with vercel.json env group / preview env config / Edge Config / KV store. Guard against: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Test with vercel env pull + vercel list + project settings audit.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific vercel.json env group / preview env config / Edge Config / KV store this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Vercel Environment Variables process" — produce a reusable CLI that handles Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.
- "Automate Vercel Environment Variables" — create a dry-run mode and test with vercel env pull.
__USB_SKILL_192C520383481084__

write_file "$PACK_DIR/skills/web-scraping-ethics-script.md" <<'__USB_SKILL_F5325A0875BD6436__'
---
description: "[Web Scraping Ethics & Compliance] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper."
slug: web-scraping-ethics-script
name: Web Scraping Ethics & Compliance: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:web-scraping-ethics, workflow:script, automation, scraping, ethics, research
---

# Web Scraping Ethics & Compliance: Script

[Web Scraping Ethics & Compliance] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..

## When to use it
Create a reusable automation for "Web Scraping Ethics & Compliance". The task produces robots.txt check / polite scraper / rate-limited crawler / cached scraper. Handle the failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.". Include a dry-run mode and test with curl robots.txt + wget --wait + scraper log audit.

## Protocol
You are automating a workflow for Web Scraping Ethics & Compliance. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with robots.txt check / polite scraper / rate-limited crawler / cached scraper. Guard against: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Test with curl robots.txt + wget --wait + scraper log audit.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Web Scraping Ethics & Compliance process" — produce a reusable CLI that handles Scraping a website that explicitly prohibits it in robots.
- "Automate Web Scraping Ethics & Compliance" — create a dry-run mode and test with curl robots.txt.
__USB_SKILL_F5325A0875BD6436__

write_file "$PACK_DIR/skills/websocket-reconnection-script.md" <<'__USB_SKILL_7E9B83B5ECE7AEE6__'
---
description: "[WebSocket Reconnection Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets WebSocket client / reconnection logic / heartbeat / connection status component."
slug: websocket-reconnection-script
name: WebSocket Reconnection Strategies: Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:websocket-reconnection, workflow:script, automation, websocket, realtime, frontend
---

# WebSocket Reconnection Strategies: Script

[WebSocket Reconnection Strategies] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..

## When to use it
Create a reusable automation for "WebSocket Reconnection Strategies". The task produces WebSocket client / reconnection logic / heartbeat / connection status component. Handle the failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.". Include a dry-run mode and test with Browser DevTools Network tab WS filter + reconnection test with server restart.

## Protocol
You are automating a workflow for WebSocket Reconnection Strategies. Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with WebSocket client / reconnection logic / heartbeat / connection status component. Guard against: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Test with Browser DevTools Network tab WS filter + reconnection test with server restart.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the WebSocket Reconnection Strategies process" — produce a reusable CLI that handles Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.
- "Automate WebSocket Reconnection Strategies" — create a dry-run mode and test with Browser DevTools Network tab WS filter.
__USB_SKILL_7E9B83B5ECE7AEE6__

write_file "$PACK_DIR/skills/web-vitals-optimization-script.md" <<'__USB_SKILL_C4892CCF607A8E7F__'
---
description: "[Web Vitals Optimisation (LCP/CLS/INP)] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis."
slug: web-vitals-optimization-script
name: Web Vitals Optimisation (LCP/CLS/INP): Script
category: Automation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:web-vitals-optimization, workflow:script, automation, performance, web-vitals, optimisation
---

# Web Vitals Optimisation (LCP/CLS/INP): Script

[Web Vitals Optimisation (LCP/CLS/INP)] Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..

## When to use it
Create a reusable automation for "Web Vitals Optimisation (LCP/CLS/INP)". The task produces image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Handle the failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).". Include a dry-run mode and test with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension.

## Protocol
You are automating a workflow for Web Vitals Optimisation (LCP/CLS/INP). Create a reusable automation: a shell script, CLI tool, scheduled job, or workflow definition. The automation must handle edge cases (missing input, network failures, permission errors) and include a dry-run or test mode.. The automation should produce or interact with image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Guard against: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Test with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Script the Web Vitals Optimisation (LCP/CLS/INP) process" — produce a reusable CLI that handles Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).
- "Automate Web Vitals Optimisation (LCP/CLS/INP)" — create a dry-run mode and test with Lighthouse CI.
__USB_SKILL_C4892CCF607A8E7F__

write_file "$PACK_DIR/skills/memory-compressor.md" <<'__USB_SKILL_F57D109FB03E40C8__'
---
description: "Condenses a long agent session or conversation into a compact, lossless summary that preserves all decisions, code changes, risks, and next steps. Designed for handover between agents or sessions. Call this when a session is becoming too long for the context window, when handing off to another agent, or when the user asks for a session summary."
slug: memory-compressor
name: Memory Compressor
category: Context
risk: low
model_agnostic: true
agent_agnostic: true
tags: memory, compression, handoff
---

# Memory Compressor

Condenses a long agent session or conversation into a compact, lossless summary that preserves all decisions, code changes, risks, and next steps. Designed for handover between agents or sessions.

## When to use it
Call this when a session is becoming too long for the context window, when handing off to another agent, or when the user asks for a session summary.

## Protocol
Scan the conversation chronologically. Extract: (1) decisions made and their rationale, (2) files created or modified (with diff summary), (3) open risks or unresolved questions, (4) verification commands run and their results, (5) explicit next steps. Format as a structured markdown document with headings. Omit chitchat, speculation, and redundant exploration. Preserve all exact file paths, function names, and command invocations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **transcript** (text, required): The full conversation or session log to compress.

## Output contract
- **response** (markdown): Structured markdown response.

## Examples
- Compress a 2-hour debugging session into a single-page handoff note for the next engineer.
- Summarise a multi-step refactor: original architecture, changes made, remaining work, and three test commands to validate the refactor.
__USB_SKILL_F57D109FB03E40C8__

write_file "$PACK_DIR/skills/a-b-testing-framework-diagnose.md" <<'__USB_SKILL_FFF6E0D6C697455E__'
---
description: "[A/B Testing Framework] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets experiment spec / variant assignment / metric definition / statistical analysis script."
slug: a-b-testing-framework-diagnose
name: A/B Testing Framework: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:a-b-testing-framework, workflow:diagnose, diagnostics, ab-testing, experiments, product
---

# A/B Testing Framework: Diagnose

[A/B Testing Framework] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..

## When to use it
Diagnose a problem in "A/B Testing Framework". The failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise." is a likely candidate. Isolate the root cause with minimal experiments. Use statsmodels sample size calculation + Bayesian A/B test + sequential testing for verification.

## Protocol
You are diagnosing a failure in A/B Testing Framework. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Use statsmodels sample size calculation + Bayesian A/B test + sequential testing to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose A/B Testing Framework failure" — run statsmodels sample size calculation and isolate root cause.
- "Fix A/B Testing Framework error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_FFF6E0D6C697455E__

write_file "$PACK_DIR/skills/a11y-aria-patterns-diagnose.md" <<'__USB_SKILL_5CAE9AA4E2E73AF9__'
---
description: "[Accessibility ARIA Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script."
slug: a11y-aria-patterns-diagnose
name: Accessibility ARIA Patterns: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:a11y-aria-patterns, workflow:diagnose, diagnostics, accessibility, aria, testing
---

# Accessibility ARIA Patterns: Diagnose

[Accessibility ARIA Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..

## When to use it
Diagnose a problem in "Accessibility ARIA Patterns". The failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers." is a likely candidate. Isolate the root cause with minimal experiments. Use axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit for verification.

## Protocol
You are diagnosing a failure in Accessibility ARIA Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Use axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Accessibility ARIA Patterns failure" — run axe-core and isolate root cause.
- "Fix Accessibility ARIA Patterns error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_5CAE9AA4E2E73AF9__

write_file "$PACK_DIR/skills/agent-tool-binding-diagnose.md" <<'__USB_SKILL_E1BF9D3168CEE2FB__'
---
description: "[Agent Tool Binding & Dispatch] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets router tool / domain group / dynamic tool injection / tool usage statistics."
slug: agent-tool-binding-diagnose
name: Agent Tool Binding & Dispatch: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:agent-tool-binding, workflow:diagnose, diagnostics, agents, tool-binding, orchestration
---

# Agent Tool Binding & Dispatch: Diagnose

[Agent Tool Binding & Dispatch] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..

## When to use it
Diagnose a problem in "Agent Tool Binding & Dispatch". The failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly." is a likely candidate. Isolate the root cause with minimal experiments. Use agent trace log + tool invocation frequency analysis + token cost audit for verification.

## Protocol
You are diagnosing a failure in Agent Tool Binding & Dispatch. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Use agent trace log + tool invocation frequency analysis + token cost audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Agent Tool Binding & Dispatch failure" — run agent trace log and isolate root cause.
- "Fix Agent Tool Binding & Dispatch error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_E1BF9D3168CEE2FB__

write_file "$PACK_DIR/skills/analytics-metric-definition-diagnose.md" <<'__USB_SKILL_D26EED94282586DC__'
---
description: "[Analytics Metric Definitions] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation."
slug: analytics-metric-definition-diagnose
name: Analytics Metric Definitions: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:analytics-metric-definition, workflow:diagnose, diagnostics, analytics, metrics, data
---

# Analytics Metric Definitions: Diagnose

[Analytics Metric Definitions] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..

## When to use it
Diagnose a problem in "Analytics Metric Definitions". The failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers." is a likely candidate. Isolate the root cause with minimal experiments. Use dbt docs generate + dbt test --select tag:metrics + metric comparison script for verification.

## Protocol
You are diagnosing a failure in Analytics Metric Definitions. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Use dbt docs generate + dbt test --select tag:metrics + metric comparison script to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Analytics Metric Definitions failure" — run dbt docs generate and isolate root cause.
- "Fix Analytics Metric Definitions error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_D26EED94282586DC__

write_file "$PACK_DIR/skills/adr-documentation-diagnose.md" <<'__USB_SKILL_9B89DB2E105BFDCF__'
---
description: "[Architecture Decision Records] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets ADR document / decision log / template / review workflow."
slug: adr-documentation-diagnose
name: Architecture Decision Records: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:adr-documentation, workflow:diagnose, diagnostics, documentation, adr, architecture
---

# Architecture Decision Records: Diagnose

[Architecture Decision Records] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..

## When to use it
Diagnose a problem in "Architecture Decision Records". The failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done." is a likely candidate. Isolate the root cause with minimal experiments. Use adr-tools list + adr-tools generate + decision log index page for verification.

## Protocol
You are diagnosing a failure in Architecture Decision Records. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Use adr-tools list + adr-tools generate + decision log index page to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ADR document / decision log / template / review workflow this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Architecture Decision Records failure" — run adr-tools list and isolate root cause.
- "Fix Architecture Decision Records error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_9B89DB2E105BFDCF__

write_file "$PACK_DIR/skills/aws-lambda-cold-start-diagnose.md" <<'__USB_SKILL_74778A7434CAC734__'
---
description: "[AWS Lambda Cold Starts] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function."
slug: aws-lambda-cold-start-diagnose
name: AWS Lambda Cold Starts: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:aws-lambda-cold-start, workflow:diagnose, diagnostics, aws, lambda, performance
---

# AWS Lambda Cold Starts: Diagnose

[AWS Lambda Cold Starts] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..

## When to use it
Diagnose a problem in "AWS Lambda Cold Starts". The failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler." is a likely candidate. Isolate the root cause with minimal experiments. Use AWS X-Ray trace + Lambda Insights + cold start dashboard for verification.

## Protocol
You are diagnosing a failure in AWS Lambda Cold Starts. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Use AWS X-Ray trace + Lambda Insights + cold start dashboard to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose AWS Lambda Cold Starts failure" — run AWS X-Ray trace and isolate root cause.
- "Fix AWS Lambda Cold Starts error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_74778A7434CAC734__

write_file "$PACK_DIR/skills/azure-bicep-diagnose.md" <<'__USB_SKILL_0679C9F552F58048__'
---
description: "[Azure Bicep Infrastructure] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets main.bicep / module / parameter file / azd template."
slug: azure-bicep-diagnose
name: Azure Bicep Infrastructure: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:azure-bicep, workflow:diagnose, diagnostics, azure, bicep, iac
---

# Azure Bicep Infrastructure: Diagnose

[Azure Bicep Infrastructure] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..

## When to use it
Diagnose a problem in "Azure Bicep Infrastructure". The failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce." is a likely candidate. Isolate the root cause with minimal experiments. Use az deployment group validate + az what-if + bicep build for verification.

## Protocol
You are diagnosing a failure in Azure Bicep Infrastructure. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Use az deployment group validate + az what-if + bicep build to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific main.bicep / module / parameter file / azd template this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Azure Bicep Infrastructure failure" — run az deployment group validate and isolate root cause.
- "Fix Azure Bicep Infrastructure error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_0679C9F552F58048__

write_file "$PACK_DIR/skills/browser-devtools-diagnose.md" <<'__USB_SKILL_C2F214E552AD147F__'
---
description: "[Browser DevTools & Debugging] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot."
slug: browser-devtools-diagnose
name: Browser DevTools & Debugging: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:browser-devtools, workflow:diagnose, diagnostics, browser, debugging, devtools
---

# Browser DevTools & Debugging: Diagnose

[Browser DevTools & Debugging] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..

## When to use it
Diagnose a problem in "Browser DevTools & Debugging". The failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically." is a likely candidate. Isolate the root cause with minimal experiments. Use Chrome DevTools performance recording + memory heap snapshot + network throttle for verification.

## Protocol
You are diagnosing a failure in Browser DevTools & Debugging. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Use Chrome DevTools performance recording + memory heap snapshot + network throttle to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Browser DevTools & Debugging failure" — run Chrome DevTools performance recording and isolate root cause.
- "Fix Browser DevTools & Debugging error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_C2F214E552AD147F__

write_file "$PACK_DIR/skills/cli-tool-design-diagnose.md" <<'__USB_SKILL_16D21FA98188FE39__'
---
description: "[CLI Tool Design Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CLI scaffolding / argument parser / exit code handler / --json output mode."
slug: cli-tool-design-diagnose
name: CLI Tool Design Patterns: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cli-tool-design, workflow:diagnose, diagnostics, cli, devtools, scripting
---

# CLI Tool Design Patterns: Diagnose

[CLI Tool Design Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..

## When to use it
Diagnose a problem in "CLI Tool Design Patterns". The failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with." is a likely candidate. Isolate the root cause with minimal experiments. Use echo $? after CLI run + stderr redirection test + --json output validation for verification.

## Protocol
You are diagnosing a failure in CLI Tool Design Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Use echo $? after CLI run + stderr redirection test + --json output validation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose CLI Tool Design Patterns failure" — run echo $? after CLI run and isolate root cause.
- "Fix CLI Tool Design Patterns error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_16D21FA98188FE39__

write_file "$PACK_DIR/skills/cloud-cost-optimization-diagnose.md" <<'__USB_SKILL_A0F59844F28042F3__'
---
description: "[Cloud Cost Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report."
slug: cloud-cost-optimization-diagnose
name: Cloud Cost Optimisation: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cloud-cost-optimization, workflow:diagnose, diagnostics, cloud, cost, optimization
---

# Cloud Cost Optimisation: Diagnose

[Cloud Cost Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..

## When to use it
Diagnose a problem in "Cloud Cost Optimisation". The failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours." is a likely candidate. Isolate the root cause with minimal experiments. Use cloud cost explorer + instance utilisation report + auto-stop Lambda function test for verification.

## Protocol
You are diagnosing a failure in Cloud Cost Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Use cloud cost explorer + instance utilisation report + auto-stop Lambda function test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Cloud Cost Optimisation failure" — run cloud cost explorer and isolate root cause.
- "Fix Cloud Cost Optimisation error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_A0F59844F28042F3__

write_file "$PACK_DIR/skills/code-review-checklist-diagnose.md" <<'__USB_SKILL_927883F680FDB26A__'
---
description: "[Code Review Checklist] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets review checklist / automated review comment / risk classification / diff summary."
slug: code-review-checklist-diagnose
name: Code Review Checklist: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:code-review-checklist, workflow:diagnose, diagnostics, code-review, quality, checklist
---

# Code Review Checklist: Diagnose

[Code Review Checklist] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..

## When to use it
Diagnose a problem in "Code Review Checklist". The failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions." is a likely candidate. Isolate the root cause with minimal experiments. Use git diff --stat + lint-staged + danger.js automated review + commitlint for verification.

## Protocol
You are diagnosing a failure in Code Review Checklist. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Use git diff --stat + lint-staged + danger.js automated review + commitlint to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific review checklist / automated review comment / risk classification / diff summary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Code Review Checklist failure" — run git diff --stat and isolate root cause.
- "Fix Code Review Checklist error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_927883F680FDB26A__

write_file "$PACK_DIR/skills/convex-functions-diagnose.md" <<'__USB_SKILL_42A79999BEA16B6B__'
---
description: "[Convex Functions & Mutations] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets mutation / query / action / component / scheduler job."
slug: convex-functions-diagnose
name: Convex Functions & Mutations: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:convex-functions, workflow:diagnose, diagnostics, convex, realtime, backend
---

# Convex Functions & Mutations: Diagnose

[Convex Functions & Mutations] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..

## When to use it
Diagnose a problem in "Convex Functions & Mutations". The failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients." is a likely candidate. Isolate the root cause with minimal experiments. Use npx convex dev + dashboard OCC conflict log + custom retry logic for verification.

## Protocol
You are diagnosing a failure in Convex Functions & Mutations. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Use npx convex dev + dashboard OCC conflict log + custom retry logic to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific mutation / query / action / component / scheduler job this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Convex Functions & Mutations failure" — run npx convex dev and isolate root cause.
- "Fix Convex Functions & Mutations error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_42A79999BEA16B6B__

write_file "$PACK_DIR/skills/cron-job-reliability-diagnose.md" <<'__USB_SKILL_99CD84E5AA8C940A__'
---
description: "[Cron Job & Scheduled Task Reliability] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets crontab entry / log rotation / idempotency guard / failure alert integration."
slug: cron-job-reliability-diagnose
name: Cron Job & Scheduled Task Reliability: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cron-job-reliability, workflow:diagnose, diagnostics, cron, scheduling, reliability
---

# Cron Job & Scheduled Task Reliability: Diagnose

[Cron Job & Scheduled Task Reliability] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..

## When to use it
Diagnose a problem in "Cron Job & Scheduled Task Reliability". The failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time." is a likely candidate. Isolate the root cause with minimal experiments. Use tail -f /var/log/cron + systemctl status cron + idempotency test script for verification.

## Protocol
You are diagnosing a failure in Cron Job & Scheduled Task Reliability. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Use tail -f /var/log/cron + systemctl status cron + idempotency test script to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Cron Job & Scheduled Task Reliability failure" — run tail -f /var/log/cron and isolate root cause.
- "Fix Cron Job & Scheduled Task Reliability error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_99CD84E5AA8C940A__

write_file "$PACK_DIR/skills/css-layout-diagnose.md" <<'__USB_SKILL_D0C5F7EAFA22A839__'
---
description: "[CSS Layout & Responsiveness] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CSS layout refactor / responsive grid / container query implementation."
slug: css-layout-diagnose
name: CSS Layout & Responsiveness: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:css-layout, workflow:diagnose, diagnostics, css, layout, frontend
---

# CSS Layout & Responsiveness: Diagnose

[CSS Layout & Responsiveness] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..

## When to use it
Diagnose a problem in "CSS Layout & Responsiveness". The failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable." is a likely candidate. Isolate the root cause with minimal experiments. Use Lighthouse mobile emulation + browser DevTools responsive mode for verification.

## Protocol
You are diagnosing a failure in CSS Layout & Responsiveness. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Use Lighthouse mobile emulation + browser DevTools responsive mode to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSS layout refactor / responsive grid / container query implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose CSS Layout & Responsiveness failure" — run Lighthouse mobile emulation and isolate root cause.
- "Fix CSS Layout & Responsiveness error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_D0C5F7EAFA22A839__

write_file "$PACK_DIR/skills/csv-data-cleaning-diagnose.md" <<'__USB_SKILL_E99EB8C9C9D0992C__'
---
description: "[CSV Data Cleaning Pipeline] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CSV parser / row validator / column type mapper / error report / cleaned output."
slug: csv-data-cleaning-diagnose
name: CSV Data Cleaning Pipeline: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:csv-data-cleaning, workflow:diagnose, diagnostics, data, csv, pipeline
---

# CSV Data Cleaning Pipeline: Diagnose

[CSV Data Cleaning Pipeline] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..

## When to use it
Diagnose a problem in "CSV Data Cleaning Pipeline". The failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines." is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -c csv.DictReader + validation script + row count diff for verification.

## Protocol
You are diagnosing a failure in CSV Data Cleaning Pipeline. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Use python3 -c csv.DictReader + validation script + row count diff to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose CSV Data Cleaning Pipeline failure" — run python3 -c csv.DictReader and isolate root cause.
- "Fix CSV Data Cleaning Pipeline error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_E99EB8C9C9D0992C__

write_file "$PACK_DIR/skills/database-migration-safety-diagnose.md" <<'__USB_SKILL_38AD56FA66F294F8__'
---
description: "[Database Migration Safety] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan."
slug: database-migration-safety-diagnose
name: Database Migration Safety: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:database-migration-safety, workflow:diagnose, diagnostics, database, migration, safety
---

# Database Migration Safety: Diagnose

[Database Migration Safety] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..

## When to use it
Diagnose a problem in "Database Migration Safety". The failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users." is a likely candidate. Isolate the root cause with minimal experiments. Use pg_locks monitoring during migration + batch backfill script + rollback test for verification.

## Protocol
You are diagnosing a failure in Database Migration Safety. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Use pg_locks monitoring during migration + batch backfill script + rollback test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Database Migration Safety failure" — run pg_locks monitoring during migration and isolate root cause.
- "Fix Database Migration Safety error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_38AD56FA66F294F8__

write_file "$PACK_DIR/skills/data-warehouse-schema-diagnose.md" <<'__USB_SKILL_DCB8D0FB873D767C__'
---
description: "[Data Warehouse Schema Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets star schema / fact table / dimension table / ETL pipeline spec."
slug: data-warehouse-schema-diagnose
name: Data Warehouse Schema Design: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:data-warehouse-schema, workflow:diagnose, diagnostics, data, warehouse, schema
---

# Data Warehouse Schema Design: Diagnose

[Data Warehouse Schema Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..

## When to use it
Diagnose a problem in "Data Warehouse Schema Design". The failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries." is a likely candidate. Isolate the root cause with minimal experiments. Use dbt run + dbt test + query profiling with warehouse-native tools for verification.

## Protocol
You are diagnosing a failure in Data Warehouse Schema Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Use dbt run + dbt test + query profiling with warehouse-native tools to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific star schema / fact table / dimension table / ETL pipeline spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Data Warehouse Schema Design failure" — run dbt run and isolate root cause.
- "Fix Data Warehouse Schema Design error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_DCB8D0FB873D767C__

write_file "$PACK_DIR/skills/design-token-system-diagnose.md" <<'__USB_SKILL_A9D8A4497EAC109E__'
---
description: "[Design Token Systems] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets token JSON / CSS custom properties / theme switcher / token documentation."
slug: design-token-system-diagnose
name: Design Token Systems: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:design-token-system, workflow:diagnose, diagnostics, design, tokens, components
---

# Design Token Systems: Diagnose

[Design Token Systems] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..

## When to use it
Diagnose a problem in "Design Token Systems". The failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file." is a likely candidate. Isolate the root cause with minimal experiments. Use style-dictionary build + Storybook token viewer + token value comparison for verification.

## Protocol
You are diagnosing a failure in Design Token Systems. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Use style-dictionary build + Storybook token viewer + token value comparison to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Design Token Systems failure" — run style-dictionary build and isolate root cause.
- "Fix Design Token Systems error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_A9D8A4497EAC109E__

write_file "$PACK_DIR/skills/docker-compose-networking-diagnose.md" <<'__USB_SKILL_A5F1C8E60381F325__'
---
description: "[Docker Compose Networking] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets docker-compose.yml / network config / healthcheck / depends_on condition."
slug: docker-compose-networking-diagnose
name: Docker Compose Networking: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:docker-compose-networking, workflow:diagnose, diagnostics, docker, networking, devops
---

# Docker Compose Networking: Diagnose

[Docker Compose Networking] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..

## When to use it
Diagnose a problem in "Docker Compose Networking". The failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name." is a likely candidate. Isolate the root cause with minimal experiments. Use docker compose up --wait + docker network inspect + container logs for verification.

## Protocol
You are diagnosing a failure in Docker Compose Networking. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Use docker compose up --wait + docker network inspect + container logs to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Docker Compose Networking failure" — run docker compose up --wait and isolate root cause.
- "Fix Docker Compose Networking error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_A5F1C8E60381F325__

write_file "$PACK_DIR/skills/docker-multistage-diagnose.md" <<'__USB_SKILL_13C642200385C5AD__'
---
description: "[Docker Multi-Stage Builds] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets multi-stage Dockerfile / .dockerignore / slim base image switch."
slug: docker-multistage-diagnose
name: Docker Multi-Stage Builds: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:docker-multistage, workflow:diagnose, diagnostics, docker, build, devops
---

# Docker Multi-Stage Builds: Diagnose

[Docker Multi-Stage Builds] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..

## When to use it
Diagnose a problem in "Docker Multi-Stage Builds". The failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure." is a likely candidate. Isolate the root cause with minimal experiments. Use docker build + docker scout + dive layer analysis for verification.

## Protocol
You are diagnosing a failure in Docker Multi-Stage Builds. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Use docker build + docker scout + dive layer analysis to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Docker Multi-Stage Builds failure" — run docker build and isolate root cause.
- "Fix Docker Multi-Stage Builds error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_13C642200385C5AD__

write_file "$PACK_DIR/skills/drizzle-schema-design-diagnose.md" <<'__USB_SKILL_4465DFB5AD5DDE28__'
---
description: "[Drizzle Schema Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets schema.ts / relation map / migration SQL / Drizzle query builder."
slug: drizzle-schema-design-diagnose
name: Drizzle Schema Design: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:drizzle-schema-design, workflow:diagnose, diagnostics, drizzle, schema, database
---

# Drizzle Schema Design: Diagnose

[Drizzle Schema Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..

## When to use it
Diagnose a problem in "Drizzle Schema Design". The failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster." is a likely candidate. Isolate the root cause with minimal experiments. Use drizzle-kit push + drizzle-kit studio + generated SQL audit for verification.

## Protocol
You are diagnosing a failure in Drizzle Schema Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Use drizzle-kit push + drizzle-kit studio + generated SQL audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Drizzle Schema Design failure" — run drizzle-kit push and isolate root cause.
- "Fix Drizzle Schema Design error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_4465DFB5AD5DDE28__

write_file "$PACK_DIR/skills/error-monitoring-setup-diagnose.md" <<'__USB_SKILL_2F4FA49976C39995__'
---
description: "[Error Monitoring & Alerting Setup] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring."
slug: error-monitoring-setup-diagnose
name: Error Monitoring & Alerting Setup: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:error-monitoring-setup, workflow:diagnose, diagnostics, monitoring, errors, alerts
---

# Error Monitoring & Alerting Setup: Diagnose

[Error Monitoring & Alerting Setup] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..

## When to use it
Diagnose a problem in "Error Monitoring & Alerting Setup". The failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains." is a likely candidate. Isolate the root cause with minimal experiments. Use Sentry API error list + alert rule test + source map validation for verification.

## Protocol
You are diagnosing a failure in Error Monitoring & Alerting Setup. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Use Sentry API error list + alert rule test + source map validation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Error Monitoring & Alerting Setup failure" — run Sentry API error list and isolate root cause.
- "Fix Error Monitoring & Alerting Setup error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_2F4FA49976C39995__

write_file "$PACK_DIR/skills/fastapi-dependencies-diagnose.md" <<'__USB_SKILL_078F1A40308F2A68__'
---
description: "[FastAPI Dependency Injection] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets dependency / lifespan handler / override for testing."
slug: fastapi-dependencies-diagnose
name: FastAPI Dependency Injection: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:fastapi-dependencies, workflow:diagnose, diagnostics, fastapi, dependencies, api
---

# FastAPI Dependency Injection: Diagnose

[FastAPI Dependency Injection] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..

## When to use it
Diagnose a problem in "FastAPI Dependency Injection". The failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection." is a likely candidate. Isolate the root cause with minimal experiments. Use uvicorn --reload + /docs interactive test + dependency graph visualisation for verification.

## Protocol
You are diagnosing a failure in FastAPI Dependency Injection. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Use uvicorn --reload + /docs interactive test + dependency graph visualisation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific dependency / lifespan handler / override for testing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose FastAPI Dependency Injection failure" — run uvicorn --reload and isolate root cause.
- "Fix FastAPI Dependency Injection error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_078F1A40308F2A68__

write_file "$PACK_DIR/skills/feature-flags-diagnose.md" <<'__USB_SKILL_B847EAD24A0D0334__'
---
description: "[Feature Flags & Gradual Rollouts] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag."
slug: feature-flags-diagnose
name: Feature Flags & Gradual Rollouts: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:feature-flags, workflow:diagnose, diagnostics, feature-flags, rollout, devops
---

# Feature Flags & Gradual Rollouts: Diagnose

[Feature Flags & Gradual Rollouts] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..

## When to use it
Diagnose a problem in "Feature Flags & Gradual Rollouts". The failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags." is a likely candidate. Isolate the root cause with minimal experiments. Use flag evaluation log + rollout percentage monitoring + unused flag scan for verification.

## Protocol
You are diagnosing a failure in Feature Flags & Gradual Rollouts. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Use flag evaluation log + rollout percentage monitoring + unused flag scan to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Feature Flags & Gradual Rollouts failure" — run flag evaluation log and isolate root cause.
- "Fix Feature Flags & Gradual Rollouts error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_B847EAD24A0D0334__

write_file "$PACK_DIR/skills/git-conflict-resolution-diagnose.md" <<'__USB_SKILL_A0F80055780A93F6__'
---
description: "[Git Conflict Resolution] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message."
slug: git-conflict-resolution-diagnose
name: Git Conflict Resolution: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:git-conflict-resolution, workflow:diagnose, diagnostics, git, conflicts, workflow
---

# Git Conflict Resolution: Diagnose

[Git Conflict Resolution] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..

## When to use it
Diagnose a problem in "Git Conflict Resolution". The failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs." is a likely candidate. Isolate the root cause with minimal experiments. Use git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere for verification.

## Protocol
You are diagnosing a failure in Git Conflict Resolution. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Use git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Git Conflict Resolution failure" — run git log --oneline -5 -- <file> and isolate root cause.
- "Fix Git Conflict Resolution error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_A0F80055780A93F6__

write_file "$PACK_DIR/skills/github-actions-pipeline-diagnose.md" <<'__USB_SKILL_8D7BC6602E97EBAE__'
---
description: "[GitHub Actions Pipeline Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets workflow YAML / cache config / matrix build / conditional job execution."
slug: github-actions-pipeline-diagnose
name: GitHub Actions Pipeline Optimisation: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:github-actions-pipeline, workflow:diagnose, diagnostics, github-actions, ci, devops
---

# GitHub Actions Pipeline Optimisation: Diagnose

[GitHub Actions Pipeline Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..

## When to use it
Diagnose a problem in "GitHub Actions Pipeline Optimisation". The failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope." is a likely candidate. Isolate the root cause with minimal experiments. Use act --job test + cache hit/miss analysis + workflow graph visualisation for verification.

## Protocol
You are diagnosing a failure in GitHub Actions Pipeline Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Use act --job test + cache hit/miss analysis + workflow graph visualisation to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific workflow YAML / cache config / matrix build / conditional job execution this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose GitHub Actions Pipeline Optimisation failure" — run act --job test and isolate root cause.
- "Fix GitHub Actions Pipeline Optimisation error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_8D7BC6602E97EBAE__

write_file "$PACK_DIR/skills/graphql-n-plus-one-diagnose.md" <<'__USB_SKILL_4322DD47295412AB__'
---
description: "[GraphQL N+1 Query Prevention] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis."
slug: graphql-n-plus-one-diagnose
name: GraphQL N+1 Query Prevention: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:graphql-n-plus-one, workflow:diagnose, diagnostics, graphql, n-plus-one, performance
---

# GraphQL N+1 Query Prevention: Diagnose

[GraphQL N+1 Query Prevention] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..

## When to use it
Diagnose a problem in "GraphQL N+1 Query Prevention". The failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children." is a likely candidate. Isolate the root cause with minimal experiments. Use graphql query with tracing + DataLoader statistics + SQL log analysis for verification.

## Protocol
You are diagnosing a failure in GraphQL N+1 Query Prevention. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Use graphql query with tracing + DataLoader statistics + SQL log analysis to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose GraphQL N+1 Query Prevention failure" — run graphql query with tracing and isolate root cause.
- "Fix GraphQL N+1 Query Prevention error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_4322DD47295412AB__

write_file "$PACK_DIR/skills/jest-test-optimization-diagnose.md" <<'__USB_SKILL_DFD4B42C8A351379__'
---
description: "[Jest Test Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking."
slug: jest-test-optimization-diagnose
name: Jest Test Optimisation: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:jest-test-optimization, workflow:diagnose, diagnostics, jest, testing, optimisation
---

# Jest Test Optimisation: Diagnose

[Jest Test Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..

## When to use it
Diagnose a problem in "Jest Test Optimisation". The failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes." is a likely candidate. Isolate the root cause with minimal experiments. Use jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check for verification.

## Protocol
You are diagnosing a failure in Jest Test Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Use jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Jest Test Optimisation failure" — run jest --changedSince=main --json and isolate root cause.
- "Fix Jest Test Optimisation error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_DFD4B42C8A351379__

write_file "$PACK_DIR/skills/json-schema-validation-diagnose.md" <<'__USB_SKILL_33AA3634987DFB9E__'
---
description: "[JSON Schema Validation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets JSON Schema / validator middleware / type guard / error message / response parser."
slug: json-schema-validation-diagnose
name: JSON Schema Validation: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:json-schema-validation, workflow:diagnose, diagnostics, json, validation, api
---

# JSON Schema Validation: Diagnose

[JSON Schema Validation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..

## When to use it
Diagnose a problem in "JSON Schema Validation". The failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly." is a likely candidate. Isolate the root cause with minimal experiments. Use ajv validate + JSON Schema test suite + response mock test for verification.

## Protocol
You are diagnosing a failure in JSON Schema Validation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Use ajv validate + JSON Schema test suite + response mock test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose JSON Schema Validation failure" — run ajv validate and isolate root cause.
- "Fix JSON Schema Validation error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_33AA3634987DFB9E__

write_file "$PACK_DIR/skills/kubernetes-hpa-diagnose.md" <<'__USB_SKILL_66B12E8CB69060FF__'
---
description: "[Kubernetes Horizontal Pod Autoscaling] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config."
slug: kubernetes-hpa-diagnose
name: Kubernetes Horizontal Pod Autoscaling: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-hpa, workflow:diagnose, diagnostics, kubernetes, autoscaling, devops
---

# Kubernetes Horizontal Pod Autoscaling: Diagnose

[Kubernetes Horizontal Pod Autoscaling] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..

## When to use it
Diagnose a problem in "Kubernetes Horizontal Pod Autoscaling". The failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment." is a likely candidate. Isolate the root cause with minimal experiments. Use kubectl get hpa --watch + kubectl top pods + metrics-server logs for verification.

## Protocol
You are diagnosing a failure in Kubernetes Horizontal Pod Autoscaling. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Use kubectl get hpa --watch + kubectl top pods + metrics-server logs to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Kubernetes Horizontal Pod Autoscaling failure" — run kubectl get hpa --watch and isolate root cause.
- "Fix Kubernetes Horizontal Pod Autoscaling error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_66B12E8CB69060FF__

write_file "$PACK_DIR/skills/kubernetes-pod-lifecycle-diagnose.md" <<'__USB_SKILL_6D898BC0FA42AD48__'
---
description: "[Kubernetes Pod Lifecycle] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container."
slug: kubernetes-pod-lifecycle-diagnose
name: Kubernetes Pod Lifecycle: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-pod-lifecycle, workflow:diagnose, diagnostics, kubernetes, pods, devops
---

# Kubernetes Pod Lifecycle: Diagnose

[Kubernetes Pod Lifecycle] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..

## When to use it
Diagnose a problem in "Kubernetes Pod Lifecycle". The failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready." is a likely candidate. Isolate the root cause with minimal experiments. Use kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' for verification.

## Protocol
You are diagnosing a failure in Kubernetes Pod Lifecycle. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Use kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Kubernetes Pod Lifecycle failure" — run kubectl describe pod and isolate root cause.
- "Fix Kubernetes Pod Lifecycle error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_6D898BC0FA42AD48__

write_file "$PACK_DIR/skills/context-window-budget-diagnose.md" <<'__USB_SKILL_D05CDACF2C9E029E__'
---
description: "[LLM Context Window Budget Management] Isolate root cause with minimal hypotheses and single-variable experiments Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard."
slug: context-window-budget-diagnose
name: LLM Context Window Budget Management: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:context-window-budget, workflow:diagnose, diagnostics, context, tokens, llm, memory, summarization
---

# LLM Context Window Budget Management: Diagnose

[LLM Context Window Budget Management] Isolate root cause with minimal hypotheses and single-variable experiments Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..

## When to use it
Diagnose a problem in "LLM Context Window Budget Management". The failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness." is a likely candidate. Isolate the root cause with minimal experiments. Use tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry for verification.

## Protocol
You are diagnosing a failure in LLM Context Window Budget Management. Isolate root cause with minimal hypotheses and single-variable experiments. The suspected failure pattern is: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Use tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves.

## Output contract
- **md** (markdown): MD output
- **cmd** (command): CMD output

## Examples
- "Diagnose LLM Context Window Budget Management failure" — run tiktoken count and isolate root cause.
- "Fix LLM Context Window Budget Management error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_D05CDACF2C9E029E__

write_file "$PACK_DIR/skills/mcp-tool-design-diagnose.md" <<'__USB_SKILL_96F1270847600093__'
---
description: "[MCP Tool Design & Best Practices] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets MCP tool descriptor / resource definition / prompt template / server metadata."
slug: mcp-tool-design-diagnose
name: MCP Tool Design & Best Practices: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:mcp-tool-design, workflow:diagnose, diagnostics, mcp, tools, agents
---

# MCP Tool Design & Best Practices: Diagnose

[MCP Tool Design & Best Practices] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..

## When to use it
Diagnose a problem in "MCP Tool Design & Best Practices". The failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent." is a likely candidate. Isolate the root cause with minimal experiments. Use mcp-cli run + mcp inspector + tool name conflict analysis for verification.

## Protocol
You are diagnosing a failure in MCP Tool Design & Best Practices. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Use mcp-cli run + mcp inspector + tool name conflict analysis to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose MCP Tool Design & Best Practices failure" — run mcp-cli run and isolate root cause.
- "Fix MCP Tool Design & Best Practices error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_96F1270847600093__

write_file "$PACK_DIR/skills/message-queues-diagnose.md" <<'__USB_SKILL_C6CB7C42199BECB1__'
---
description: "[Message Queues & Background Jobs] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets queue producer / worker / dead-letter handler / retry policy."
slug: message-queues-diagnose
name: Message Queues & Background Jobs: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:message-queues, workflow:diagnose, diagnostics, queue, background-jobs, backend
---

# Message Queues & Background Jobs: Diagnose

[Message Queues & Background Jobs] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..

## When to use it
Diagnose a problem in "Message Queues & Background Jobs". The failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled." is a likely candidate. Isolate the root cause with minimal experiments. Use Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection for verification.

## Protocol
You are diagnosing a failure in Message Queues & Background Jobs. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Use Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific queue producer / worker / dead-letter handler / retry policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Message Queues & Background Jobs failure" — run Bull/BullMQ dashboard and isolate root cause.
- "Fix Message Queues & Background Jobs error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_C6CB7C42199BECB1__

write_file "$PACK_DIR/skills/multi-tenant-isolation-diagnose.md" <<'__USB_SKILL_1A319DE04CBF07F1__'
---
description: "[Multi-Tenant Data Isolation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder."
slug: multi-tenant-isolation-diagnose
name: Multi-Tenant Data Isolation: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:multi-tenant-isolation, workflow:diagnose, diagnostics, multi-tenant, saas, database
---

# Multi-Tenant Data Isolation: Diagnose

[Multi-Tenant Data Isolation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..

## When to use it
Diagnose a problem in "Multi-Tenant Data Isolation". The failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data." is a likely candidate. Isolate the root cause with minimal experiments. Use RLS policy test with two different tenant sessions + data leakage check for verification.

## Protocol
You are diagnosing a failure in Multi-Tenant Data Isolation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Use RLS policy test with two different tenant sessions + data leakage check to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Multi-Tenant Data Isolation failure" — run RLS policy test with two different tenant sessions and isolate root cause.
- "Fix Multi-Tenant Data Isolation error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_1A319DE04CBF07F1__

write_file "$PACK_DIR/skills/nextjs-api-routes-diagnose.md" <<'__USB_SKILL_E4DA6A38FE76E4F4__'
---
description: "[Next.js API Routes & Route Handlers] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets route.ts handler / server action / API client wrapper / error boundary."
slug: nextjs-api-routes-diagnose
name: Next.js API Routes & Route Handlers: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-api-routes, workflow:diagnose, diagnostics, nextjs, api, backend
---

# Next.js API Routes & Route Handlers: Diagnose

[Next.js API Routes & Route Handlers] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..

## When to use it
Diagnose a problem in "Next.js API Routes & Route Handlers". The failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component." is a likely candidate. Isolate the root cause with minimal experiments. Use curl --verbose + API route error log + status code audit for verification.

## Protocol
You are diagnosing a failure in Next.js API Routes & Route Handlers. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Use curl --verbose + API route error log + status code audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific route.ts handler / server action / API client wrapper / error boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Next.js API Routes & Route Handlers failure" — run curl --verbose and isolate root cause.
- "Fix Next.js API Routes & Route Handlers error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_E4DA6A38FE76E4F4__

write_file "$PACK_DIR/skills/nextjs-data-fetching-diagnose.md" <<'__USB_SKILL_81DFBEAF2DA01301__'
---
description: "[Next.js Data Fetching Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets server fetch / React cache wrapper / streaming suspense boundary."
slug: nextjs-data-fetching-diagnose
name: Next.js Data Fetching Patterns: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-data-fetching, workflow:diagnose, diagnostics, nextjs, data-fetching, fullstack
---

# Next.js Data Fetching Patterns: Diagnose

[Next.js Data Fetching Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..

## When to use it
Diagnose a problem in "Next.js Data Fetching Patterns". The failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests." is a likely candidate. Isolate the root cause with minimal experiments. Use next build --debug + React DevTools fetch profiling for verification.

## Protocol
You are diagnosing a failure in Next.js Data Fetching Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Use next build --debug + React DevTools fetch profiling to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server fetch / React cache wrapper / streaming suspense boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Next.js Data Fetching Patterns failure" — run next build --debug and isolate root cause.
- "Fix Next.js Data Fetching Patterns error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_81DFBEAF2DA01301__

write_file "$PACK_DIR/skills/nextjs-middleware-diagnose.md" <<'__USB_SKILL_43EB3D8A41BA62B6__'
---
description: "[Next.js Middleware & Edge Runtime] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing."
slug: nextjs-middleware-diagnose
name: Next.js Middleware & Edge Runtime: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-middleware, workflow:diagnose, diagnostics, nextjs, middleware, edge
---

# Next.js Middleware & Edge Runtime: Diagnose

[Next.js Middleware & Edge Runtime] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..

## When to use it
Diagnose a problem in "Next.js Middleware & Edge Runtime". The failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes." is a likely candidate. Isolate the root cause with minimal experiments. Use next dev + curl --cookie tests + edge runtime log inspection for verification.

## Protocol
You are diagnosing a failure in Next.js Middleware & Edge Runtime. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Use next dev + curl --cookie tests + edge runtime log inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Next.js Middleware & Edge Runtime failure" — run next dev and isolate root cause.
- "Fix Next.js Middleware & Edge Runtime error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_43EB3D8A41BA62B6__

write_file "$PACK_DIR/skills/node-error-handling-diagnose.md" <<'__USB_SKILL_0149091FECF30700__'
---
description: "[Node.js Error Handling & Resilience] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets global error handler / async wrapper / structured error response / retry logic."
slug: node-error-handling-diagnose
name: Node.js Error Handling & Resilience: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:node-error-handling, workflow:diagnose, diagnostics, node, error-handling, backend
---

# Node.js Error Handling & Resilience: Diagnose

[Node.js Error Handling & Resilience] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..

## When to use it
Diagnose a problem in "Node.js Error Handling & Resilience". The failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context." is a likely candidate. Isolate the root cause with minimal experiments. Use node --unhandled-rejections=strict + process.on('uncaughtException') log for verification.

## Protocol
You are diagnosing a failure in Node.js Error Handling & Resilience. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Use node --unhandled-rejections=strict + process.on('uncaughtException') log to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific global error handler / async wrapper / structured error response / retry logic this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Node.js Error Handling & Resilience failure" — run node --unhandled-rejections=strict and isolate root cause.
- "Fix Node.js Error Handling & Resilience error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_0149091FECF30700__

write_file "$PACK_DIR/skills/node-streams-diagnose.md" <<'__USB_SKILL_5033A87A22104965__'
---
description: "[Node.js Streams & Backpressure] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Readable/Writable stream / Transform / pipeline() refactor."
slug: node-streams-diagnose
name: Node.js Streams & Backpressure: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:node-streams, workflow:diagnose, diagnostics, node, streams, performance
---

# Node.js Streams & Backpressure: Diagnose

[Node.js Streams & Backpressure] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..

## When to use it
Diagnose a problem in "Node.js Streams & Backpressure". The failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams." is a likely candidate. Isolate the root cause with minimal experiments. Use Node.js --inspect memory heap snapshot + stream highWaterMark tuning for verification.

## Protocol
You are diagnosing a failure in Node.js Streams & Backpressure. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Use Node.js --inspect memory heap snapshot + stream highWaterMark tuning to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Readable/Writable stream / Transform / pipeline() refactor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Node.js Streams & Backpressure failure" — run Node.js --inspect memory heap snapshot and isolate root cause.
- "Fix Node.js Streams & Backpressure error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_5033A87A22104965__

write_file "$PACK_DIR/skills/oauth-flows-diagnose.md" <<'__USB_SKILL_EA4BE62FA56237D9__'
---
description: "[OAuth 2.0 Flows & Token Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler."
slug: oauth-flows-diagnose
name: OAuth 2.0 Flows & Token Management: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:oauth-flows, workflow:diagnose, diagnostics, oauth, auth, security
---

# OAuth 2.0 Flows & Token Management: Diagnose

[OAuth 2.0 Flows & Token Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..

## When to use it
Diagnose a problem in "OAuth 2.0 Flows & Token Management". The failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation." is a likely candidate. Isolate the root cause with minimal experiments. Use oauth2_proxy + jwt.io debugger + curl --cookie with token inspection for verification.

## Protocol
You are diagnosing a failure in OAuth 2.0 Flows & Token Management. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Use oauth2_proxy + jwt.io debugger + curl --cookie with token inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose OAuth 2.0 Flows & Token Management failure" — run oauth2_proxy and isolate root cause.
- "Fix OAuth 2.0 Flows & Token Management error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_EA4BE62FA56237D9__

write_file "$PACK_DIR/skills/openapi-spec-diagnose.md" <<'__USB_SKILL_919EC89E62EAF58B__'
---
description: "[OpenAPI Specification & Validation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets openapi.yaml / code-first generator / request/response validation middleware."
slug: openapi-spec-diagnose
name: OpenAPI Specification & Validation: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:openapi-spec, workflow:diagnose, diagnostics, openapi, api, contract
---

# OpenAPI Specification & Validation: Diagnose

[OpenAPI Specification & Validation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..

## When to use it
Diagnose a problem in "OpenAPI Specification & Validation". The failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code." is a likely candidate. Isolate the root cause with minimal experiments. Use redocly lint + openapi-diff + swagger-ui preview for verification.

## Protocol
You are diagnosing a failure in OpenAPI Specification & Validation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Use redocly lint + openapi-diff + swagger-ui preview to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific openapi.yaml / code-first generator / request/response validation middleware this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose OpenAPI Specification & Validation failure" — run redocly lint and isolate root cause.
- "Fix OpenAPI Specification & Validation error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_919EC89E62EAF58B__

write_file "$PACK_DIR/skills/playwright-selectors-diagnose.md" <<'__USB_SKILL_2F8880C66B3BED00__'
---
description: "[Playwright Selectors & Locators] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture."
slug: playwright-selectors-diagnose
name: Playwright Selectors & Locators: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:playwright-selectors, workflow:diagnose, diagnostics, playwright, testing, e2e
---

# Playwright Selectors & Locators: Diagnose

[Playwright Selectors & Locators] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..

## When to use it
Diagnose a problem in "Playwright Selectors & Locators". The failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update." is a likely candidate. Isolate the root cause with minimal experiments. Use playwright test --reporter=html + playwright codegen + trace viewer for verification.

## Protocol
You are diagnosing a failure in Playwright Selectors & Locators. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Use playwright test --reporter=html + playwright codegen + trace viewer to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Playwright Selectors & Locators failure" — run playwright test --reporter=html and isolate root cause.
- "Fix Playwright Selectors & Locators error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_2F8880C66B3BED00__

write_file "$PACK_DIR/skills/prompt-injection-defense-diagnose.md" <<'__USB_SKILL_BAB00A8CCE3C70AB__'
---
description: "[Prompt Injection Defense] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator."
slug: prompt-injection-defense-diagnose
name: Prompt Injection Defense: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:prompt-injection-defense, workflow:diagnose, diagnostics, prompt, security, llm
---

# Prompt Injection Defense: Diagnose

[Prompt Injection Defense] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..

## When to use it
Diagnose a problem in "Prompt Injection Defense". The failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'." is a likely candidate. Isolate the root cause with minimal experiments. Use prompt injection test suite + adversarial input fuzzing + output scanner for verification.

## Protocol
You are diagnosing a failure in Prompt Injection Defense. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Use prompt injection test suite + adversarial input fuzzing + output scanner to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Prompt Injection Defense failure" — run prompt injection test suite and isolate root cause.
- "Fix Prompt Injection Defense error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_BAB00A8CCE3C70AB__

write_file "$PACK_DIR/skills/python-async-diagnose.md" <<'__USB_SKILL_F1AD7D1C025C2A51__'
---
description: "[Python Async/Await Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets async/await refactor / asyncio.gather / async context manager."
slug: python-async-diagnose
name: Python Async/Await Patterns: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:python-async, workflow:diagnose, diagnostics, python, async, performance
---

# Python Async/Await Patterns: Diagnose

[Python Async/Await Patterns] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..

## When to use it
Diagnose a problem in "Python Async/Await Patterns". The failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions." is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -m asyncio + aiohttp/httpx async benchmark for verification.

## Protocol
You are diagnosing a failure in Python Async/Await Patterns. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Use python3 -m asyncio + aiohttp/httpx async benchmark to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific async/await refactor / asyncio.gather / async context manager this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Python Async/Await Patterns failure" — run python3 -m asyncio and isolate root cause.
- "Fix Python Async/Await Patterns error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_F1AD7D1C025C2A51__

write_file "$PACK_DIR/skills/python-file-io-diagnose.md" <<'__USB_SKILL_E7CE2A057CA7E7AB__'
---
description: "[Python File I/O & Encoding] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets pathlib refactor / encoding-safe file reader / batch file processor."
slug: python-file-io-diagnose
name: Python File I/O & Encoding: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:python-file-io, workflow:diagnose, diagnostics, python, file-io, scripting
---

# Python File I/O & Encoding: Diagnose

[Python File I/O & Encoding] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..

## When to use it
Diagnose a problem in "Python File I/O & Encoding". The failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content." is a likely candidate. Isolate the root cause with minimal experiments. Use python3 -c with open() + chardet encoding detection for verification.

## Protocol
You are diagnosing a failure in Python File I/O & Encoding. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Use python3 -c with open() + chardet encoding detection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Python File I/O & Encoding failure" — run python3 -c with open() and isolate root cause.
- "Fix Python File I/O & Encoding error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_E7CE2A057CA7E7AB__

write_file "$PACK_DIR/skills/rag-chunking-diagnose.md" <<'__USB_SKILL_3FF79335629EB226__'
---
description: "[RAG Chunking Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment."
slug: rag-chunking-diagnose
name: RAG Chunking Strategies: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rag-chunking, workflow:diagnose, diagnostics, rag, chunking, retrieval
---

# RAG Chunking Strategies: Diagnose

[RAG Chunking Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..

## When to use it
Diagnose a problem in "RAG Chunking Strategies". The failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality." is a likely candidate. Isolate the root cause with minimal experiments. Use retrieval evaluation script + chunk boundary visualisation + recall@k measurement for verification.

## Protocol
You are diagnosing a failure in RAG Chunking Strategies. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Use retrieval evaluation script + chunk boundary visualisation + recall@k measurement to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose RAG Chunking Strategies failure" — run retrieval evaluation script and isolate root cause.
- "Fix RAG Chunking Strategies error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_3FF79335629EB226__

write_file "$PACK_DIR/skills/rate-limiting-proxy-diagnose.md" <<'__USB_SKILL_CF642DC22A74FFF7__'
---
description: "[Rate Limiting & API Gateway Proxy] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation."
slug: rate-limiting-proxy-diagnose
name: Rate Limiting & API Gateway Proxy: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rate-limiting-proxy, workflow:diagnose, diagnostics, rate-limiting, proxy, security
---

# Rate Limiting & API Gateway Proxy: Diagnose

[Rate Limiting & API Gateway Proxy] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..

## When to use it
Diagnose a problem in "Rate Limiting & API Gateway Proxy". The failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources." is a likely candidate. Isolate the root cause with minimal experiments. Use ab -n 1000 -c 10 + nginx error log + 429 response code monitoring for verification.

## Protocol
You are diagnosing a failure in Rate Limiting & API Gateway Proxy. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Use ab -n 1000 -c 10 + nginx error log + 429 response code monitoring to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Rate Limiting & API Gateway Proxy failure" — run ab -n 1000 -c 10 and isolate root cause.
- "Fix Rate Limiting & API Gateway Proxy error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_CF642DC22A74FFF7__

write_file "$PACK_DIR/skills/react-server-components-diagnose.md" <<'__USB_SKILL_4A8831E3A4585BE9__'
---
description: "[React Server Components] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets server component / client boundary refactor / streaming fallback."
slug: react-server-components-diagnose
name: React Server Components: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:react-server-components, workflow:diagnose, diagnostics, react, rsc, frontend
---

# React Server Components: Diagnose

[React Server Components] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..

## When to use it
Diagnose a problem in "React Server Components". The failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file." is a likely candidate. Isolate the root cause with minimal experiments. Use next build --debug + React Server Components lint rule for verification.

## Protocol
You are diagnosing a failure in React Server Components. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Use next build --debug + React Server Components lint rule to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server component / client boundary refactor / streaming fallback this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose React Server Components failure" — run next build --debug and isolate root cause.
- "Fix React Server Components error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_4A8831E3A4585BE9__

write_file "$PACK_DIR/skills/react-state-diagnose.md" <<'__USB_SKILL_E20390DD03D92123__'
---
description: "[React State Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice."
slug: react-state-diagnose
name: React State Management: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:react-state, workflow:diagnose, diagnostics, react, state, frontend
---

# React State Management: Diagnose

[React State Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..

## When to use it
Diagnose a problem in "React State Management". The failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation." is a likely candidate. Isolate the root cause with minimal experiments. Use React DevTools profiler + why-did-you-render for verification.

## Protocol
You are diagnosing a failure in React State Management. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Use React DevTools profiler + why-did-you-render to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose React State Management failure" — run React DevTools profiler and isolate root cause.
- "Fix React State Management error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_E20390DD03D92123__

write_file "$PACK_DIR/skills/redis-caching-diagnose.md" <<'__USB_SKILL_E0E0A183894278EC__'
---
description: "[Redis Caching Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy."
slug: redis-caching-diagnose
name: Redis Caching Strategies: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:redis-caching, workflow:diagnose, diagnostics, redis, caching, performance
---

# Redis Caching Strategies: Diagnose

[Redis Caching Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..

## When to use it
Diagnose a problem in "Redis Caching Strategies". The failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time." is a likely candidate. Isolate the root cause with minimal experiments. Use redis-cli --stat + cache hit ratio monitoring + slow log for verification.

## Protocol
You are diagnosing a failure in Redis Caching Strategies. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Use redis-cli --stat + cache hit ratio monitoring + slow log to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Redis Caching Strategies failure" — run redis-cli --stat and isolate root cause.
- "Fix Redis Caching Strategies error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_E0E0A183894278EC__

write_file "$PACK_DIR/skills/rest-pagination-diagnose.md" <<'__USB_SKILL_8D8AA34FB11A0F02__'
---
description: "[REST Pagination Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope."
slug: rest-pagination-diagnose
name: REST Pagination Design: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rest-pagination, workflow:diagnose, diagnostics, rest, pagination, api
---

# REST Pagination Design: Diagnose

[REST Pagination Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..

## When to use it
Diagnose a problem in "REST Pagination Design". The failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows." is a likely candidate. Isolate the root cause with minimal experiments. Use curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark for verification.

## Protocol
You are diagnosing a failure in REST Pagination Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Use curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose REST Pagination Design failure" — run curl with cursor param and isolate root cause.
- "Fix REST Pagination Design error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_8D8AA34FB11A0F02__

write_file "$PACK_DIR/skills/secrets-rotation-diagnose.md" <<'__USB_SKILL_D3D28CA4F02458EA__'
---
description: "[Secrets Rotation Policy] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets rotation script / vault integration / lease management / incident response plan."
slug: secrets-rotation-diagnose
name: Secrets Rotation Policy: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:secrets-rotation, workflow:diagnose, diagnostics, secrets, security, rotation
---

# Secrets Rotation Policy: Diagnose

[Secrets Rotation Policy] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..

## When to use it
Diagnose a problem in "Secrets Rotation Policy". The failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak." is a likely candidate. Isolate the root cause with minimal experiments. Use vault lease list + secret expiry check + rotation dry-run test for verification.

## Protocol
You are diagnosing a failure in Secrets Rotation Policy. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Use vault lease list + secret expiry check + rotation dry-run test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific rotation script / vault integration / lease management / incident response plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Secrets Rotation Policy failure" — run vault lease list and isolate root cause.
- "Fix Secrets Rotation Policy error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_D3D28CA4F02458EA__

write_file "$PACK_DIR/skills/shell-script-robustness-diagnose.md" <<'__USB_SKILL_390E280F8B6ABF52__'
---
description: "[Shell Script Robustness & Safety] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function."
slug: shell-script-robustness-diagnose
name: Shell Script Robustness & Safety: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:shell-script-robustness, workflow:diagnose, diagnostics, shell, scripting, safety
---

# Shell Script Robustness & Safety: Diagnose

[Shell Script Robustness & Safety] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..

## When to use it
Diagnose a problem in "Shell Script Robustness & Safety". The failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage." is a likely candidate. Isolate the root cause with minimal experiments. Use shellcheck script.sh + bash -n script.sh + dry-run mode test for verification.

## Protocol
You are diagnosing a failure in Shell Script Robustness & Safety. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Use shellcheck script.sh + bash -n script.sh + dry-run mode test to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Shell Script Robustness & Safety failure" — run shellcheck script.sh and isolate root cause.
- "Fix Shell Script Robustness & Safety error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_390E280F8B6ABF52__

write_file "$PACK_DIR/skills/sql-query-optimization-diagnose.md" <<'__USB_SKILL_6FF03D963BCC3245__'
---
description: "[SQL Query Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index."
slug: sql-query-optimization-diagnose
name: SQL Query Optimisation: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:sql-query-optimization, workflow:diagnose, diagnostics, sql, optimization, database
---

# SQL Query Optimisation: Diagnose

[SQL Query Optimisation] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..

## When to use it
Diagnose a problem in "SQL Query Optimisation". The failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs." is a likely candidate. Isolate the root cause with minimal experiments. Use EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query for verification.

## Protocol
You are diagnosing a failure in SQL Query Optimisation. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Use EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose SQL Query Optimisation failure" — run EXPLAIN (ANALYSE, BUFFERS) and isolate root cause.
- "Fix SQL Query Optimisation error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_6FF03D963BCC3245__

write_file "$PACK_DIR/skills/stealth-web-research-diagnose.md" <<'__USB_SKILL_A6F234BF12C47B1E__'
---
description: "[Stealth Web Research & Harvesting] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages."
slug: stealth-web-research-diagnose
name: Stealth Web Research & Harvesting: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:stealth-web-research, workflow:diagnose, diagnostics, stealth, scraping, research, anti-bot
---

# Stealth Web Research & Harvesting: Diagnose

[Stealth Web Research & Harvesting] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..

## When to use it
Diagnose a problem in "Stealth Web Research & Harvesting". The failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests." is a likely candidate. Isolate the root cause with minimal experiments. Use playwright-extra + stealth + cheerio + defuddle + manual jq inspection for verification.

## Protocol
You are diagnosing a failure in Stealth Web Research & Harvesting. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Use playwright-extra + stealth + cheerio + defuddle + manual jq inspection to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Stealth Web Research & Harvesting failure" — run playwright-extra and isolate root cause.
- "Fix Stealth Web Research & Harvesting error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_A6F234BF12C47B1E__

write_file "$PACK_DIR/skills/stripe-webhook-idempotency-diagnose.md" <<'__USB_SKILL_6390ACF5881714C6__'
---
description: "[Stripe Webhook Idempotency] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery."
slug: stripe-webhook-idempotency-diagnose
name: Stripe Webhook Idempotency: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:stripe-webhook-idempotency, workflow:diagnose, diagnostics, stripe, webhook, payments
---

# Stripe Webhook Idempotency: Diagnose

[Stripe Webhook Idempotency] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..

## When to use it
Diagnose a problem in "Stripe Webhook Idempotency". The failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations." is a likely candidate. Isolate the root cause with minimal experiments. Use stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check for verification.

## Protocol
You are diagnosing a failure in Stripe Webhook Idempotency. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Use stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Stripe Webhook Idempotency failure" — run stripe trigger payment_intent.succeeded and isolate root cause.
- "Fix Stripe Webhook Idempotency error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_6390ACF5881714C6__

write_file "$PACK_DIR/skills/supabase-rls-diagnose.md" <<'__USB_SKILL_6F45583849203796__'
---
description: "[Supabase Row-Level Security] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets RLS policy / policy test / security definer function / admin bypass."
slug: supabase-rls-diagnose
name: Supabase Row-Level Security: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:supabase-rls, workflow:diagnose, diagnostics, supabase, rls, security
---

# Supabase Row-Level Security: Diagnose

[Supabase Row-Level Security] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..

## When to use it
Diagnose a problem in "Supabase Row-Level Security". The failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data." is a likely candidate. Isolate the root cause with minimal experiments. Use supabase db check + supabase db test + RLS policy review with pg_policies for verification.

## Protocol
You are diagnosing a failure in Supabase Row-Level Security. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Use supabase db check + supabase db test + RLS policy review with pg_policies to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / policy test / security definer function / admin bypass this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Supabase Row-Level Security failure" — run supabase db check and isolate root cause.
- "Fix Supabase Row-Level Security error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_6F45583849203796__

write_file "$PACK_DIR/skills/terraform-state-diagnose.md" <<'__USB_SKILL_E18BFA322471DE67__'
---
description: "[Terraform State Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets backend config / state migration plan / state locking config / remote state datasource."
slug: terraform-state-diagnose
name: Terraform State Management: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:terraform-state, workflow:diagnose, diagnostics, terraform, state, iac
---

# Terraform State Management: Diagnose

[Terraform State Management] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..

## When to use it
Diagnose a problem in "Terraform State Management". The failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure." is a likely candidate. Isolate the root cause with minimal experiments. Use terraform plan + terraform state list + terraform state pull | jq for verification.

## Protocol
You are diagnosing a failure in Terraform State Management. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Use terraform plan + terraform state list + terraform state pull | jq to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific backend config / state migration plan / state locking config / remote state datasource this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Terraform State Management failure" — run terraform plan and isolate root cause.
- "Fix Terraform State Management error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_E18BFA322471DE67__

write_file "$PACK_DIR/skills/typescript-generics-diagnose.md" <<'__USB_SKILL_D8096EB7BF554756__'
---
description: "[TypeScript Generics & Advanced Types] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets generic type / conditional type / mapped type / branded type."
slug: typescript-generics-diagnose
name: TypeScript Generics & Advanced Types: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:typescript-generics, workflow:diagnose, diagnostics, typescript, generics, type-system
---

# TypeScript Generics & Advanced Types: Diagnose

[TypeScript Generics & Advanced Types] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..

## When to use it
Diagnose a problem in "TypeScript Generics & Advanced Types". The failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)." is a likely candidate. Isolate the root cause with minimal experiments. Use tsc --noEmit --strict + type tests with expect-type for verification.

## Protocol
You are diagnosing a failure in TypeScript Generics & Advanced Types. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Use tsc --noEmit --strict + type tests with expect-type to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific generic type / conditional type / mapped type / branded type this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose TypeScript Generics & Advanced Types failure" — run tsc --noEmit --strict and isolate root cause.
- "Fix TypeScript Generics & Advanced Types error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_D8096EB7BF554756__

write_file "$PACK_DIR/skills/user-onboarding-flow-diagnose.md" <<'__USB_SKILL_D91EBAE85C9DF3E4__'
---
description: "[User Onboarding Flow Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec."
slug: user-onboarding-flow-diagnose
name: User Onboarding Flow Design: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:user-onboarding-flow, workflow:diagnose, diagnostics, ux, onboarding, product
---

# User Onboarding Flow Design: Diagnose

[User Onboarding Flow Design] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..

## When to use it
Diagnose a problem in "User Onboarding Flow Design". The failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value." is a likely candidate. Isolate the root cause with minimal experiments. Use analytics funnel analysis + onboarding completion rate + drop-off heatmap for verification.

## Protocol
You are diagnosing a failure in User Onboarding Flow Design. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Use analytics funnel analysis + onboarding completion rate + drop-off heatmap to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose User Onboarding Flow Design failure" — run analytics funnel analysis and isolate root cause.
- "Fix User Onboarding Flow Design error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_D91EBAE85C9DF3E4__

write_file "$PACK_DIR/skills/vercel-env-vars-diagnose.md" <<'__USB_SKILL_FF4018A44CBE100C__'
---
description: "[Vercel Environment Variables] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets vercel.json env group / preview env config / Edge Config / KV store."
slug: vercel-env-vars-diagnose
name: Vercel Environment Variables: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:vercel-env-vars, workflow:diagnose, diagnostics, vercel, env, deployment
---

# Vercel Environment Variables: Diagnose

[Vercel Environment Variables] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..

## When to use it
Diagnose a problem in "Vercel Environment Variables". The failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments." is a likely candidate. Isolate the root cause with minimal experiments. Use vercel env pull + vercel list + project settings audit for verification.

## Protocol
You are diagnosing a failure in Vercel Environment Variables. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Use vercel env pull + vercel list + project settings audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific vercel.json env group / preview env config / Edge Config / KV store this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Vercel Environment Variables failure" — run vercel env pull and isolate root cause.
- "Fix Vercel Environment Variables error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_FF4018A44CBE100C__

write_file "$PACK_DIR/skills/web-scraping-ethics-diagnose.md" <<'__USB_SKILL_472CFF5305996BF1__'
---
description: "[Web Scraping Ethics & Compliance] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper."
slug: web-scraping-ethics-diagnose
name: Web Scraping Ethics & Compliance: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:web-scraping-ethics, workflow:diagnose, diagnostics, scraping, ethics, research
---

# Web Scraping Ethics & Compliance: Diagnose

[Web Scraping Ethics & Compliance] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..

## When to use it
Diagnose a problem in "Web Scraping Ethics & Compliance". The failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues." is a likely candidate. Isolate the root cause with minimal experiments. Use curl robots.txt + wget --wait + scraper log audit for verification.

## Protocol
You are diagnosing a failure in Web Scraping Ethics & Compliance. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Use curl robots.txt + wget --wait + scraper log audit to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Web Scraping Ethics & Compliance failure" — run curl robots.txt and isolate root cause.
- "Fix Web Scraping Ethics & Compliance error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_472CFF5305996BF1__

write_file "$PACK_DIR/skills/websocket-reconnection-diagnose.md" <<'__USB_SKILL_76706114D429F77F__'
---
description: "[WebSocket Reconnection Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets WebSocket client / reconnection logic / heartbeat / connection status component."
slug: websocket-reconnection-diagnose
name: WebSocket Reconnection Strategies: Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:websocket-reconnection, workflow:diagnose, diagnostics, websocket, realtime, frontend
---

# WebSocket Reconnection Strategies: Diagnose

[WebSocket Reconnection Strategies] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..

## When to use it
Diagnose a problem in "WebSocket Reconnection Strategies". The failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state." is a likely candidate. Isolate the root cause with minimal experiments. Use Browser DevTools Network tab WS filter + reconnection test with server restart for verification.

## Protocol
You are diagnosing a failure in WebSocket Reconnection Strategies. Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Use Browser DevTools Network tab WS filter + reconnection test with server restart to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose WebSocket Reconnection Strategies failure" — run Browser DevTools Network tab WS filter and isolate root cause.
- "Fix WebSocket Reconnection Strategies error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_76706114D429F77F__

write_file "$PACK_DIR/skills/web-vitals-optimization-diagnose.md" <<'__USB_SKILL_B940FC76E751F27F__'
---
description: "[Web Vitals Optimisation (LCP/CLS/INP)] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis."
slug: web-vitals-optimization-diagnose
name: Web Vitals Optimisation (LCP/CLS/INP): Diagnose
category: Diagnostics
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:web-vitals-optimization, workflow:diagnose, diagnostics, performance, web-vitals, optimisation
---

# Web Vitals Optimisation (LCP/CLS/INP): Diagnose

[Web Vitals Optimisation (LCP/CLS/INP)] Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..

## When to use it
Diagnose a problem in "Web Vitals Optimisation (LCP/CLS/INP)". The failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)." is a likely candidate. Isolate the root cause with minimal experiments. Use Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension for verification.

## Protocol
You are diagnosing a failure in Web Vitals Optimisation (LCP/CLS/INP). Isolate the root cause of a failure. Separate symptoms from causes. Generate hypotheses in order of likelihood. Test each with a minimal, single-variable experiment. Once the cause is confirmed, propose a minimal fix.. The suspected failure pattern is: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Use Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension to isolate the root cause. Do not apply a permanent fix until the cause is confirmed.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Diagnose Web Vitals Optimisation (LCP/CLS/INP) failure" — run Lighthouse CI and isolate root cause.
- "Fix Web Vitals Optimisation (LCP/CLS/INP) error" — confirm hypothesis with a single verification command before applying a permanent fix.
__USB_SKILL_B940FC76E751F27F__

write_file "$PACK_DIR/skills/a-b-testing-framework-explain.md" <<'__USB_SKILL_9AA246763A8243E9__'
---
description: "[A/B Testing Framework] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets experiment spec / variant assignment / metric definition / statistical analysis script."
slug: a-b-testing-framework-explain
name: A/B Testing Framework: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:a-b-testing-framework, workflow:explain, docs, ab-testing, experiments, product
---

# A/B Testing Framework: Explain

[A/B Testing Framework] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..

## When to use it
Write documentation for "A/B Testing Framework". Cover: what it is, when to use it, the Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise. pitfall, and how to verify with statsmodels sample size calculation + Bayesian A/B test + sequential testing. Output must be readable by both humans and AI agents.

## Protocol
You are documenting A/B Testing Framework. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (experiment spec / variant assignment / metric definition / statistical analysis script), the common failure pattern (Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.), the best practice (Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.), and the verification command (statsmodels sample size calculation + Bayesian A/B test + sequential testing).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document experiment spec / variant assignment / metric definition / statistical analysis script" — write a runbook with setup, usage, and troubleshooting.
- "Explain A/B Testing Framework architecture" — produce an ADR covering Use an online sample size calculator before starting the test.
__USB_SKILL_9AA246763A8243E9__

write_file "$PACK_DIR/skills/a11y-aria-patterns-explain.md" <<'__USB_SKILL_427764F15E3D79FE__'
---
description: "[Accessibility ARIA Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script."
slug: a11y-aria-patterns-explain
name: Accessibility ARIA Patterns: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:a11y-aria-patterns, workflow:explain, docs, accessibility, aria, testing
---

# Accessibility ARIA Patterns: Explain

[Accessibility ARIA Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..

## When to use it
Write documentation for "Accessibility ARIA Patterns". Cover: what it is, when to use it, the Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers. pitfall, and how to verify with axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Accessibility ARIA Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (ARIA attribute refactor / keyboard navigation / focus management / screen reader test script), the common failure pattern (Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.), the best practice (Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.), and the verification command (axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document ARIA attribute refactor / keyboard navigation / focus management / screen reader test script" — write a runbook with setup, usage, and troubleshooting.
- "Explain Accessibility ARIA Patterns architecture" — produce an ADR covering Use native HTML elements whenever possible.
__USB_SKILL_427764F15E3D79FE__

write_file "$PACK_DIR/skills/agent-tool-binding-explain.md" <<'__USB_SKILL_8D139343373CE0CA__'
---
description: "[Agent Tool Binding & Dispatch] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets router tool / domain group / dynamic tool injection / tool usage statistics."
slug: agent-tool-binding-explain
name: Agent Tool Binding & Dispatch: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:agent-tool-binding, workflow:explain, docs, agents, tool-binding, orchestration
---

# Agent Tool Binding & Dispatch: Explain

[Agent Tool Binding & Dispatch] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..

## When to use it
Write documentation for "Agent Tool Binding & Dispatch". Cover: what it is, when to use it, the Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly. pitfall, and how to verify with agent trace log + tool invocation frequency analysis + token cost audit. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Agent Tool Binding & Dispatch. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (router tool / domain group / dynamic tool injection / tool usage statistics), the common failure pattern (Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.), the best practice (Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.), and the verification command (agent trace log + tool invocation frequency analysis + token cost audit).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document router tool / domain group / dynamic tool injection / tool usage statistics" — write a runbook with setup, usage, and troubleshooting.
- "Explain Agent Tool Binding & Dispatch architecture" — produce an ADR covering Group tools by domain and offer a 'router' tool first.
__USB_SKILL_8D139343373CE0CA__

write_file "$PACK_DIR/skills/analytics-metric-definition-explain.md" <<'__USB_SKILL_BD0020D42A77FE94__'
---
description: "[Analytics Metric Definitions] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation."
slug: analytics-metric-definition-explain
name: Analytics Metric Definitions: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:analytics-metric-definition, workflow:explain, docs, analytics, metrics, data
---

# Analytics Metric Definitions: Explain

[Analytics Metric Definitions] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..

## When to use it
Write documentation for "Analytics Metric Definitions". Cover: what it is, when to use it, the Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers. pitfall, and how to verify with dbt docs generate + dbt test --select tag:metrics + metric comparison script. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Analytics Metric Definitions. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (metric definition / dbt model / SQL logic / dashboard tile / documentation), the common failure pattern (Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.), the best practice (Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.), and the verification command (dbt docs generate + dbt test --select tag:metrics + metric comparison script).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document metric definition / dbt model / SQL logic / dashboard tile / documentation" — write a runbook with setup, usage, and troubleshooting.
- "Explain Analytics Metric Definitions architecture" — produce an ADR covering Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.
__USB_SKILL_BD0020D42A77FE94__

write_file "$PACK_DIR/skills/adr-documentation-explain.md" <<'__USB_SKILL_7BCF02B8C4E1C647__'
---
description: "[Architecture Decision Records] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets ADR document / decision log / template / review workflow."
slug: adr-documentation-explain
name: Architecture Decision Records: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:adr-documentation, workflow:explain, docs, documentation, adr, architecture
---

# Architecture Decision Records: Explain

[Architecture Decision Records] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..

## When to use it
Write documentation for "Architecture Decision Records". Cover: what it is, when to use it, the Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done. pitfall, and how to verify with adr-tools list + adr-tools generate + decision log index page. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Architecture Decision Records. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (ADR document / decision log / template / review workflow), the common failure pattern (Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.), the best practice (Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.), and the verification command (adr-tools list + adr-tools generate + decision log index page).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ADR document / decision log / template / review workflow this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document ADR document / decision log / template / review workflow" — write a runbook with setup, usage, and troubleshooting.
- "Explain Architecture Decision Records architecture" — produce an ADR covering Write an ADR for every non-trivial decision.
__USB_SKILL_7BCF02B8C4E1C647__

write_file "$PACK_DIR/skills/aws-lambda-cold-start-explain.md" <<'__USB_SKILL_F74AAAA515A6C985__'
---
description: "[AWS Lambda Cold Starts] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function."
slug: aws-lambda-cold-start-explain
name: AWS Lambda Cold Starts: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:aws-lambda-cold-start, workflow:explain, docs, aws, lambda, performance
---

# AWS Lambda Cold Starts: Explain

[AWS Lambda Cold Starts] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..

## When to use it
Write documentation for "AWS Lambda Cold Starts". Cover: what it is, when to use it, the Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler. pitfall, and how to verify with AWS X-Ray trace + Lambda Insights + cold start dashboard. Output must be readable by both humans and AI agents.

## Protocol
You are documenting AWS Lambda Cold Starts. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (handler refactor / SnapStart config / Provisioned Concurrency / warmer function), the common failure pattern (Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.), the best practice (Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.), and the verification command (AWS X-Ray trace + Lambda Insights + cold start dashboard).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document handler refactor / SnapStart config / Provisioned Concurrency / warmer function" — write a runbook with setup, usage, and troubleshooting.
- "Explain AWS Lambda Cold Starts architecture" — produce an ADR covering Move initialisation (DB connections, config loading) outside the handler.
__USB_SKILL_F74AAAA515A6C985__

write_file "$PACK_DIR/skills/azure-bicep-explain.md" <<'__USB_SKILL_A82F49FBE73A8E4E__'
---
description: "[Azure Bicep Infrastructure] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets main.bicep / module / parameter file / azd template."
slug: azure-bicep-explain
name: Azure Bicep Infrastructure: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:azure-bicep, workflow:explain, docs, azure, bicep, iac
---

# Azure Bicep Infrastructure: Explain

[Azure Bicep Infrastructure] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..

## When to use it
Write documentation for "Azure Bicep Infrastructure". Cover: what it is, when to use it, the Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce. pitfall, and how to verify with az deployment group validate + az what-if + bicep build. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Azure Bicep Infrastructure. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (main.bicep / module / parameter file / azd template), the common failure pattern (Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.), the best practice (Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.), and the verification command (az deployment group validate + az what-if + bicep build).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific main.bicep / module / parameter file / azd template this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document main.bicep / module / parameter file / azd template" — write a runbook with setup, usage, and troubleshooting.
- "Explain Azure Bicep Infrastructure architecture" — produce an ADR covering Always define Azure resources in Bicep or Terraform.
__USB_SKILL_A82F49FBE73A8E4E__

write_file "$PACK_DIR/skills/browser-devtools-explain.md" <<'__USB_SKILL_668F7DF62A514BEF__'
---
description: "[Browser DevTools & Debugging] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot."
slug: browser-devtools-explain
name: Browser DevTools & Debugging: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:browser-devtools, workflow:explain, docs, browser, debugging, devtools
---

# Browser DevTools & Debugging: Explain

[Browser DevTools & Debugging] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..

## When to use it
Write documentation for "Browser DevTools & Debugging". Cover: what it is, when to use it, the Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically. pitfall, and how to verify with Chrome DevTools performance recording + memory heap snapshot + network throttle. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Browser DevTools & Debugging. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (debugging workflow / breakpoint guide / performance recording / memory snapshot), the common failure pattern (Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.), the best practice (Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.), and the verification command (Chrome DevTools performance recording + memory heap snapshot + network throttle).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document debugging workflow / breakpoint guide / performance recording / memory snapshot" — write a runbook with setup, usage, and troubleshooting.
- "Explain Browser DevTools & Debugging architecture" — produce an ADR covering Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.
__USB_SKILL_668F7DF62A514BEF__

write_file "$PACK_DIR/skills/cli-tool-design-explain.md" <<'__USB_SKILL_5330664D0A601717__'
---
description: "[CLI Tool Design Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CLI scaffolding / argument parser / exit code handler / --json output mode."
slug: cli-tool-design-explain
name: CLI Tool Design Patterns: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:cli-tool-design, workflow:explain, docs, cli, devtools, scripting
---

# CLI Tool Design Patterns: Explain

[CLI Tool Design Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..

## When to use it
Write documentation for "CLI Tool Design Patterns". Cover: what it is, when to use it, the Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with. pitfall, and how to verify with echo $? after CLI run + stderr redirection test + --json output validation. Output must be readable by both humans and AI agents.

## Protocol
You are documenting CLI Tool Design Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (CLI scaffolding / argument parser / exit code handler / --json output mode), the common failure pattern (Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.), the best practice (Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.), and the verification command (echo $? after CLI run + stderr redirection test + --json output validation).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document CLI scaffolding / argument parser / exit code handler / --json output mode" — write a runbook with setup, usage, and troubleshooting.
- "Explain CLI Tool Design Patterns architecture" — produce an ADR covering Always exit 0 on success, non-zero on failure.
__USB_SKILL_5330664D0A601717__

write_file "$PACK_DIR/skills/cloud-cost-optimization-explain.md" <<'__USB_SKILL_2EDEBA1B1B10ED87__'
---
description: "[Cloud Cost Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report."
slug: cloud-cost-optimization-explain
name: Cloud Cost Optimisation: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:cloud-cost-optimization, workflow:explain, docs, cloud, cost, optimization
---

# Cloud Cost Optimisation: Explain

[Cloud Cost Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..

## When to use it
Write documentation for "Cloud Cost Optimisation". Cover: what it is, when to use it, the Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours. pitfall, and how to verify with cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Cloud Cost Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report), the common failure pattern (Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.), the best practice (Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.), and the verification command (cloud cost explorer + instance utilisation report + auto-stop Lambda function test).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report" — write a runbook with setup, usage, and troubleshooting.
- "Explain Cloud Cost Optimisation architecture" — produce an ADR covering Right-size instances based on actual usage metrics (not peak theoretical load).
__USB_SKILL_2EDEBA1B1B10ED87__

write_file "$PACK_DIR/skills/code-review-checklist-explain.md" <<'__USB_SKILL_6B4C31603540037B__'
---
description: "[Code Review Checklist] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets review checklist / automated review comment / risk classification / diff summary."
slug: code-review-checklist-explain
name: Code Review Checklist: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:code-review-checklist, workflow:explain, docs, code-review, quality, checklist
---

# Code Review Checklist: Explain

[Code Review Checklist] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..

## When to use it
Write documentation for "Code Review Checklist". Cover: what it is, when to use it, the Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions. pitfall, and how to verify with git diff --stat + lint-staged + danger.js automated review + commitlint. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Code Review Checklist. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (review checklist / automated review comment / risk classification / diff summary), the common failure pattern (Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.), the best practice (Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.), and the verification command (git diff --stat + lint-staged + danger.js automated review + commitlint).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific review checklist / automated review comment / risk classification / diff summary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document review checklist / automated review comment / risk classification / diff summary" — write a runbook with setup, usage, and troubleshooting.
- "Explain Code Review Checklist architecture" — produce an ADR covering Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.
__USB_SKILL_6B4C31603540037B__

write_file "$PACK_DIR/skills/convex-functions-explain.md" <<'__USB_SKILL_71ED540D0E0BE625__'
---
description: "[Convex Functions & Mutations] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets mutation / query / action / component / scheduler job."
slug: convex-functions-explain
name: Convex Functions & Mutations: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:convex-functions, workflow:explain, docs, convex, realtime, backend
---

# Convex Functions & Mutations: Explain

[Convex Functions & Mutations] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..

## When to use it
Write documentation for "Convex Functions & Mutations". Cover: what it is, when to use it, the Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients. pitfall, and how to verify with npx convex dev + dashboard OCC conflict log + custom retry logic. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Convex Functions & Mutations. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (mutation / query / action / component / scheduler job), the common failure pattern (Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.), the best practice (Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.), and the verification command (npx convex dev + dashboard OCC conflict log + custom retry logic).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific mutation / query / action / component / scheduler job this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document mutation / query / action / component / scheduler job" — write a runbook with setup, usage, and troubleshooting.
- "Explain Convex Functions & Mutations architecture" — produce an ADR covering Use patch() for partial updates and batch mutations for atomic multi-document writes.
__USB_SKILL_71ED540D0E0BE625__

write_file "$PACK_DIR/skills/cron-job-reliability-explain.md" <<'__USB_SKILL_C5979830DB459E1D__'
---
description: "[Cron Job & Scheduled Task Reliability] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets crontab entry / log rotation / idempotency guard / failure alert integration."
slug: cron-job-reliability-explain
name: Cron Job & Scheduled Task Reliability: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:cron-job-reliability, workflow:explain, docs, cron, scheduling, reliability
---

# Cron Job & Scheduled Task Reliability: Explain

[Cron Job & Scheduled Task Reliability] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..

## When to use it
Write documentation for "Cron Job & Scheduled Task Reliability". Cover: what it is, when to use it, the Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time. pitfall, and how to verify with tail -f /var/log/cron + systemctl status cron + idempotency test script. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Cron Job & Scheduled Task Reliability. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (crontab entry / log rotation / idempotency guard / failure alert integration), the common failure pattern (Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.), the best practice (Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.), and the verification command (tail -f /var/log/cron + systemctl status cron + idempotency test script).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document crontab entry / log rotation / idempotency guard / failure alert integration" — write a runbook with setup, usage, and troubleshooting.
- "Explain Cron Job & Scheduled Task Reliability architecture" — produce an ADR covering Redirect cron output to a log file with timestamp.
__USB_SKILL_C5979830DB459E1D__

write_file "$PACK_DIR/skills/css-layout-explain.md" <<'__USB_SKILL_24C1362C71FFB018__'
---
description: "[CSS Layout & Responsiveness] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CSS layout refactor / responsive grid / container query implementation."
slug: css-layout-explain
name: CSS Layout & Responsiveness: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:css-layout, workflow:explain, docs, css, layout, frontend
---

# CSS Layout & Responsiveness: Explain

[CSS Layout & Responsiveness] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..

## When to use it
Write documentation for "CSS Layout & Responsiveness". Cover: what it is, when to use it, the Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable. pitfall, and how to verify with Lighthouse mobile emulation + browser DevTools responsive mode. Output must be readable by both humans and AI agents.

## Protocol
You are documenting CSS Layout & Responsiveness. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (CSS layout refactor / responsive grid / container query implementation), the common failure pattern (Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.), the best practice (Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.), and the verification command (Lighthouse mobile emulation + browser DevTools responsive mode).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSS layout refactor / responsive grid / container query implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document CSS layout refactor / responsive grid / container query implementation" — write a runbook with setup, usage, and troubleshooting.
- "Explain CSS Layout & Responsiveness architecture" — produce an ADR covering Design for the content, not the viewport.
__USB_SKILL_24C1362C71FFB018__

write_file "$PACK_DIR/skills/csv-data-cleaning-explain.md" <<'__USB_SKILL_5B8CCB3F405B576C__'
---
description: "[CSV Data Cleaning Pipeline] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CSV parser / row validator / column type mapper / error report / cleaned output."
slug: csv-data-cleaning-explain
name: CSV Data Cleaning Pipeline: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:csv-data-cleaning, workflow:explain, docs, data, csv, pipeline
---

# CSV Data Cleaning Pipeline: Explain

[CSV Data Cleaning Pipeline] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..

## When to use it
Write documentation for "CSV Data Cleaning Pipeline". Cover: what it is, when to use it, the Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines. pitfall, and how to verify with python3 -c csv.DictReader + validation script + row count diff. Output must be readable by both humans and AI agents.

## Protocol
You are documenting CSV Data Cleaning Pipeline. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (CSV parser / row validator / column type mapper / error report / cleaned output), the common failure pattern (Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.), the best practice (Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.), and the verification command (python3 -c csv.DictReader + validation script + row count diff).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document CSV parser / row validator / column type mapper / error report / cleaned output" — write a runbook with setup, usage, and troubleshooting.
- "Explain CSV Data Cleaning Pipeline architecture" — produce an ADR covering Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas.
__USB_SKILL_5B8CCB3F405B576C__

write_file "$PACK_DIR/skills/database-migration-safety-explain.md" <<'__USB_SKILL_2B10C3F496A22E22__'
---
description: "[Database Migration Safety] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan."
slug: database-migration-safety-explain
name: Database Migration Safety: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:database-migration-safety, workflow:explain, docs, database, migration, safety
---

# Database Migration Safety: Explain

[Database Migration Safety] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..

## When to use it
Write documentation for "Database Migration Safety". Cover: what it is, when to use it, the Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users. pitfall, and how to verify with pg_locks monitoring during migration + batch backfill script + rollback test. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Database Migration Safety. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (batch migration / expand-contract pattern / zero-downtime migration / rollback plan), the common failure pattern (Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.), the best practice (Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.), and the verification command (pg_locks monitoring during migration + batch backfill script + rollback test).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document batch migration / expand-contract pattern / zero-downtime migration / rollback plan" — write a runbook with setup, usage, and troubleshooting.
- "Explain Database Migration Safety architecture" — produce an ADR covering Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.
__USB_SKILL_2B10C3F496A22E22__

write_file "$PACK_DIR/skills/data-warehouse-schema-explain.md" <<'__USB_SKILL_A4AD6F476022C69C__'
---
description: "[Data Warehouse Schema Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets star schema / fact table / dimension table / ETL pipeline spec."
slug: data-warehouse-schema-explain
name: Data Warehouse Schema Design: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:data-warehouse-schema, workflow:explain, docs, data, warehouse, schema
---

# Data Warehouse Schema Design: Explain

[Data Warehouse Schema Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..

## When to use it
Write documentation for "Data Warehouse Schema Design". Cover: what it is, when to use it, the Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries. pitfall, and how to verify with dbt run + dbt test + query profiling with warehouse-native tools. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Data Warehouse Schema Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (star schema / fact table / dimension table / ETL pipeline spec), the common failure pattern (Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.), the best practice (Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.), and the verification command (dbt run + dbt test + query profiling with warehouse-native tools).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific star schema / fact table / dimension table / ETL pipeline spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document star schema / fact table / dimension table / ETL pipeline spec" — write a runbook with setup, usage, and troubleshooting.
- "Explain Data Warehouse Schema Design architecture" — produce an ADR covering Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries.
__USB_SKILL_A4AD6F476022C69C__

write_file "$PACK_DIR/skills/design-token-system-explain.md" <<'__USB_SKILL_026B003BAB19711D__'
---
description: "[Design Token Systems] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets token JSON / CSS custom properties / theme switcher / token documentation."
slug: design-token-system-explain
name: Design Token Systems: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:design-token-system, workflow:explain, docs, design, tokens, components
---

# Design Token Systems: Explain

[Design Token Systems] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..

## When to use it
Write documentation for "Design Token Systems". Cover: what it is, when to use it, the Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file. pitfall, and how to verify with style-dictionary build + Storybook token viewer + token value comparison. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Design Token Systems. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (token JSON / CSS custom properties / theme switcher / token documentation), the common failure pattern (Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.), the best practice (Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.), and the verification command (style-dictionary build + Storybook token viewer + token value comparison).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document token JSON / CSS custom properties / theme switcher / token documentation" — write a runbook with setup, usage, and troubleshooting.
- "Explain Design Token Systems architecture" — produce an ADR covering Define all visual primitives as CSS custom properties or JSON tokens.
__USB_SKILL_026B003BAB19711D__

write_file "$PACK_DIR/skills/docker-compose-networking-explain.md" <<'__USB_SKILL_C985D2971579DF80__'
---
description: "[Docker Compose Networking] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets docker-compose.yml / network config / healthcheck / depends_on condition."
slug: docker-compose-networking-explain
name: Docker Compose Networking: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:docker-compose-networking, workflow:explain, docs, docker, networking, devops
---

# Docker Compose Networking: Explain

[Docker Compose Networking] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..

## When to use it
Write documentation for "Docker Compose Networking". Cover: what it is, when to use it, the Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name. pitfall, and how to verify with docker compose up --wait + docker network inspect + container logs. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Docker Compose Networking. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (docker-compose.yml / network config / healthcheck / depends_on condition), the common failure pattern (Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.), the best practice (All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.), and the verification command (docker compose up --wait + docker network inspect + container logs).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document docker-compose.yml / network config / healthcheck / depends_on condition" — write a runbook with setup, usage, and troubleshooting.
- "Explain Docker Compose Networking architecture" — produce an ADR covering All services in the same docker-compose.
__USB_SKILL_C985D2971579DF80__

write_file "$PACK_DIR/skills/docker-multistage-explain.md" <<'__USB_SKILL_2F7F69D282CE120F__'
---
description: "[Docker Multi-Stage Builds] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets multi-stage Dockerfile / .dockerignore / slim base image switch."
slug: docker-multistage-explain
name: Docker Multi-Stage Builds: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:docker-multistage, workflow:explain, docs, docker, build, devops
---

# Docker Multi-Stage Builds: Explain

[Docker Multi-Stage Builds] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..

## When to use it
Write documentation for "Docker Multi-Stage Builds". Cover: what it is, when to use it, the Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure. pitfall, and how to verify with docker build + docker scout + dive layer analysis. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Docker Multi-Stage Builds. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (multi-stage Dockerfile / .dockerignore / slim base image switch), the common failure pattern (Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.), the best practice (Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.), and the verification command (docker build + docker scout + dive layer analysis).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document multi-stage Dockerfile / .dockerignore / slim base image switch" — write a runbook with setup, usage, and troubleshooting.
- "Explain Docker Multi-Stage Builds architecture" — produce an ADR covering Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.
__USB_SKILL_2F7F69D282CE120F__

write_file "$PACK_DIR/skills/drizzle-schema-design-explain.md" <<'__USB_SKILL_58057C3EA53AFAA6__'
---
description: "[Drizzle Schema Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets schema.ts / relation map / migration SQL / Drizzle query builder."
slug: drizzle-schema-design-explain
name: Drizzle Schema Design: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:drizzle-schema-design, workflow:explain, docs, drizzle, schema, database
---

# Drizzle Schema Design: Explain

[Drizzle Schema Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..

## When to use it
Write documentation for "Drizzle Schema Design". Cover: what it is, when to use it, the Over-using relations() when simple foreign key columns with manual joins would be clearer and faster. pitfall, and how to verify with drizzle-kit push + drizzle-kit studio + generated SQL audit. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Drizzle Schema Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (schema.ts / relation map / migration SQL / Drizzle query builder), the common failure pattern (Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.), the best practice (Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.), and the verification command (drizzle-kit push + drizzle-kit studio + generated SQL audit).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document schema.ts / relation map / migration SQL / Drizzle query builder" — write a runbook with setup, usage, and troubleshooting.
- "Explain Drizzle Schema Design architecture" — produce an ADR covering Define relations only for eagerly loaded nested data.
__USB_SKILL_58057C3EA53AFAA6__

write_file "$PACK_DIR/skills/error-monitoring-setup-explain.md" <<'__USB_SKILL_4608DAB8738E165C__'
---
description: "[Error Monitoring & Alerting Setup] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring."
slug: error-monitoring-setup-explain
name: Error Monitoring & Alerting Setup: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:error-monitoring-setup, workflow:explain, docs, monitoring, errors, alerts
---

# Error Monitoring & Alerting Setup: Explain

[Error Monitoring & Alerting Setup] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..

## When to use it
Write documentation for "Error Monitoring & Alerting Setup". Cover: what it is, when to use it, the Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains. pitfall, and how to verify with Sentry API error list + alert rule test + source map validation. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Error Monitoring & Alerting Setup. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (Sentry project config / alert rule / error grouping / source map upload / performance monitoring), the common failure pattern (Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.), the best practice (Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).), and the verification command (Sentry API error list + alert rule test + source map validation).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document Sentry project config / alert rule / error grouping / source map upload / performance monitoring" — write a runbook with setup, usage, and troubleshooting.
- "Explain Error Monitoring & Alerting Setup architecture" — produce an ADR covering Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).
__USB_SKILL_4608DAB8738E165C__

write_file "$PACK_DIR/skills/fastapi-dependencies-explain.md" <<'__USB_SKILL_09609E2E9D9430E9__'
---
description: "[FastAPI Dependency Injection] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets dependency / lifespan handler / override for testing."
slug: fastapi-dependencies-explain
name: FastAPI Dependency Injection: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:fastapi-dependencies, workflow:explain, docs, fastapi, dependencies, api
---

# FastAPI Dependency Injection: Explain

[FastAPI Dependency Injection] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..

## When to use it
Write documentation for "FastAPI Dependency Injection". Cover: what it is, when to use it, the Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection. pitfall, and how to verify with uvicorn --reload + /docs interactive test + dependency graph visualisation. Output must be readable by both humans and AI agents.

## Protocol
You are documenting FastAPI Dependency Injection. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (dependency / lifespan handler / override for testing), the common failure pattern (Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.), the best practice (Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().), and the verification command (uvicorn --reload + /docs interactive test + dependency graph visualisation).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific dependency / lifespan handler / override for testing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document dependency / lifespan handler / override for testing" — write a runbook with setup, usage, and troubleshooting.
- "Explain FastAPI Dependency Injection architecture" — produce an ADR covering Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().
__USB_SKILL_09609E2E9D9430E9__

write_file "$PACK_DIR/skills/feature-flags-explain.md" <<'__USB_SKILL_AA12C7E05845519D__'
---
description: "[Feature Flags & Gradual Rollouts] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag."
slug: feature-flags-explain
name: Feature Flags & Gradual Rollouts: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:feature-flags, workflow:explain, docs, feature-flags, rollout, devops
---

# Feature Flags & Gradual Rollouts: Explain

[Feature Flags & Gradual Rollouts] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..

## When to use it
Write documentation for "Feature Flags & Gradual Rollouts". Cover: what it is, when to use it, the Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags. pitfall, and how to verify with flag evaluation log + rollout percentage monitoring + unused flag scan. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Feature Flags & Gradual Rollouts. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (flag provider config / gradual rollout target / flag cleanup plan / A/B test flag), the common failure pattern (Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.), the best practice (Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.), and the verification command (flag evaluation log + rollout percentage monitoring + unused flag scan).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document flag provider config / gradual rollout target / flag cleanup plan / A/B test flag" — write a runbook with setup, usage, and troubleshooting.
- "Explain Feature Flags & Gradual Rollouts architecture" — produce an ADR covering Treat feature flags as temporary.
__USB_SKILL_AA12C7E05845519D__

write_file "$PACK_DIR/skills/git-conflict-resolution-explain.md" <<'__USB_SKILL_7412DF7FA6DF520E__'
---
description: "[Git Conflict Resolution] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message."
slug: git-conflict-resolution-explain
name: Git Conflict Resolution: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:git-conflict-resolution, workflow:explain, docs, git, conflicts, workflow
---

# Git Conflict Resolution: Explain

[Git Conflict Resolution] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..

## When to use it
Write documentation for "Git Conflict Resolution". Cover: what it is, when to use it, the Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs. pitfall, and how to verify with git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Git Conflict Resolution. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message), the common failure pattern (Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.), the best practice (For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.), and the verification command (git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message" — write a runbook with setup, usage, and troubleshooting.
- "Explain Git Conflict Resolution architecture" — produce an ADR covering For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file.
__USB_SKILL_7412DF7FA6DF520E__

write_file "$PACK_DIR/skills/github-actions-pipeline-explain.md" <<'__USB_SKILL_1863B9B53C5C2BC0__'
---
description: "[GitHub Actions Pipeline Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets workflow YAML / cache config / matrix build / conditional job execution."
slug: github-actions-pipeline-explain
name: GitHub Actions Pipeline Optimisation: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:github-actions-pipeline, workflow:explain, docs, github-actions, ci, devops
---

# GitHub Actions Pipeline Optimisation: Explain

[GitHub Actions Pipeline Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..

## When to use it
Write documentation for "GitHub Actions Pipeline Optimisation". Cover: what it is, when to use it, the Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope. pitfall, and how to verify with act --job test + cache hit/miss analysis + workflow graph visualisation. Output must be readable by both humans and AI agents.

## Protocol
You are documenting GitHub Actions Pipeline Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (workflow YAML / cache config / matrix build / conditional job execution), the common failure pattern (Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.), the best practice (Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.), and the verification command (act --job test + cache hit/miss analysis + workflow graph visualisation).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific workflow YAML / cache config / matrix build / conditional job execution this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document workflow YAML / cache config / matrix build / conditional job execution" — write a runbook with setup, usage, and troubleshooting.
- "Explain GitHub Actions Pipeline Optimisation architecture" — produce an ADR covering Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file.
__USB_SKILL_1863B9B53C5C2BC0__

write_file "$PACK_DIR/skills/graphql-n-plus-one-explain.md" <<'__USB_SKILL_29DFC38E1A46E92A__'
---
description: "[GraphQL N+1 Query Prevention] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis."
slug: graphql-n-plus-one-explain
name: GraphQL N+1 Query Prevention: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:graphql-n-plus-one, workflow:explain, docs, graphql, n-plus-one, performance
---

# GraphQL N+1 Query Prevention: Explain

[GraphQL N+1 Query Prevention] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..

## When to use it
Write documentation for "GraphQL N+1 Query Prevention". Cover: what it is, when to use it, the A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children. pitfall, and how to verify with graphql query with tracing + DataLoader statistics + SQL log analysis. Output must be readable by both humans and AI agents.

## Protocol
You are documenting GraphQL N+1 Query Prevention. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (DataLoader instance / batch load function / resolver refactor / query complexity analysis), the common failure pattern (A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.), the best practice (Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.), and the verification command (graphql query with tracing + DataLoader statistics + SQL log analysis).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document DataLoader instance / batch load function / resolver refactor / query complexity analysis" — write a runbook with setup, usage, and troubleshooting.
- "Explain GraphQL N+1 Query Prevention architecture" — produce an ADR covering Use DataLoader to batch and cache child-loading queries.
__USB_SKILL_29DFC38E1A46E92A__

write_file "$PACK_DIR/skills/jest-test-optimization-explain.md" <<'__USB_SKILL_1223F738525CC89F__'
---
description: "[Jest Test Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking."
slug: jest-test-optimization-explain
name: Jest Test Optimisation: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:jest-test-optimization, workflow:explain, docs, jest, testing, optimisation
---

# Jest Test Optimisation: Explain

[Jest Test Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..

## When to use it
Write documentation for "Jest Test Optimisation". Cover: what it is, when to use it, the Running the entire test suite on every change, taking minutes even for small incremental code changes. pitfall, and how to verify with jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Jest Test Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking), the common failure pattern (Running the entire test suite on every change, taking minutes even for small incremental code changes.), the best practice (Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.), and the verification command (jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking" — write a runbook with setup, usage, and troubleshooting.
- "Explain Jest Test Optimisation architecture" — produce an ADR covering Use jest --changedSince to run only tests related to changed files.
__USB_SKILL_1223F738525CC89F__

write_file "$PACK_DIR/skills/json-schema-validation-explain.md" <<'__USB_SKILL_B258DBC6DF3D86B5__'
---
description: "[JSON Schema Validation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets JSON Schema / validator middleware / type guard / error message / response parser."
slug: json-schema-validation-explain
name: JSON Schema Validation: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:json-schema-validation, workflow:explain, docs, json, validation, api
---

# JSON Schema Validation: Explain

[JSON Schema Validation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..

## When to use it
Write documentation for "JSON Schema Validation". Cover: what it is, when to use it, the Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly. pitfall, and how to verify with ajv validate + JSON Schema test suite + response mock test. Output must be readable by both humans and AI agents.

## Protocol
You are documenting JSON Schema Validation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (JSON Schema / validator middleware / type guard / error message / response parser), the common failure pattern (Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.), the best practice (Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.), and the verification command (ajv validate + JSON Schema test suite + response mock test).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document JSON Schema / validator middleware / type guard / error message / response parser" — write a runbook with setup, usage, and troubleshooting.
- "Explain JSON Schema Validation architecture" — produce an ADR covering Always validate external JSON responses against a JSON Schema before accessing properties.
__USB_SKILL_B258DBC6DF3D86B5__

write_file "$PACK_DIR/skills/kubernetes-hpa-explain.md" <<'__USB_SKILL_F8CA95AB002C18C2__'
---
description: "[Kubernetes Horizontal Pod Autoscaling] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config."
slug: kubernetes-hpa-explain
name: Kubernetes Horizontal Pod Autoscaling: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-hpa, workflow:explain, docs, kubernetes, autoscaling, devops
---

# Kubernetes Horizontal Pod Autoscaling: Explain

[Kubernetes Horizontal Pod Autoscaling] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..

## When to use it
Write documentation for "Kubernetes Horizontal Pod Autoscaling". Cover: what it is, when to use it, the HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment. pitfall, and how to verify with kubectl get hpa --watch + kubectl top pods + metrics-server logs. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Kubernetes Horizontal Pod Autoscaling. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config), the common failure pattern (HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.), the best practice (Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.), and the verification command (kubectl get hpa --watch + kubectl top pods + metrics-server logs).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config" — write a runbook with setup, usage, and troubleshooting.
- "Explain Kubernetes Horizontal Pod Autoscaling architecture" — produce an ADR covering Always set CPU/memory requests on every container.
__USB_SKILL_F8CA95AB002C18C2__

write_file "$PACK_DIR/skills/kubernetes-pod-lifecycle-explain.md" <<'__USB_SKILL_3445FB16EF7BD4FB__'
---
description: "[Kubernetes Pod Lifecycle] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container."
slug: kubernetes-pod-lifecycle-explain
name: Kubernetes Pod Lifecycle: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-pod-lifecycle, workflow:explain, docs, kubernetes, pods, devops
---

# Kubernetes Pod Lifecycle: Explain

[Kubernetes Pod Lifecycle] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..

## When to use it
Write documentation for "Kubernetes Pod Lifecycle". Cover: what it is, when to use it, the Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready. pitfall, and how to verify with kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Kubernetes Pod Lifecycle. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (deployment.yaml / startup probe / readiness probe / liveness probe / init container), the common failure pattern (Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.), the best practice (Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.), and the verification command (kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp').

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document deployment.yaml / startup probe / readiness probe / liveness probe / init container" — write a runbook with setup, usage, and troubleshooting.
- "Explain Kubernetes Pod Lifecycle architecture" — produce an ADR covering Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.
__USB_SKILL_3445FB16EF7BD4FB__

write_file "$PACK_DIR/skills/mcp-tool-design-explain.md" <<'__USB_SKILL_5622B2EA5F7DFED6__'
---
description: "[MCP Tool Design & Best Practices] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets MCP tool descriptor / resource definition / prompt template / server metadata."
slug: mcp-tool-design-explain
name: MCP Tool Design & Best Practices: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:mcp-tool-design, workflow:explain, docs, mcp, tools, agents
---

# MCP Tool Design & Best Practices: Explain

[MCP Tool Design & Best Practices] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..

## When to use it
Write documentation for "MCP Tool Design & Best Practices". Cover: what it is, when to use it, the Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent. pitfall, and how to verify with mcp-cli run + mcp inspector + tool name conflict analysis. Output must be readable by both humans and AI agents.

## Protocol
You are documenting MCP Tool Design & Best Practices. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (MCP tool descriptor / resource definition / prompt template / server metadata), the common failure pattern (Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.), the best practice (Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.), and the verification command (mcp-cli run + mcp inspector + tool name conflict analysis).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document MCP tool descriptor / resource definition / prompt template / server metadata" — write a runbook with setup, usage, and troubleshooting.
- "Explain MCP Tool Design & Best Practices architecture" — produce an ADR covering Prefix tool names with a namespace that reflects their domain (e.
__USB_SKILL_5622B2EA5F7DFED6__

write_file "$PACK_DIR/skills/message-queues-explain.md" <<'__USB_SKILL_6BBA33B4B851F48A__'
---
description: "[Message Queues & Background Jobs] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets queue producer / worker / dead-letter handler / retry policy."
slug: message-queues-explain
name: Message Queues & Background Jobs: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:message-queues, workflow:explain, docs, queue, background-jobs, backend
---

# Message Queues & Background Jobs: Explain

[Message Queues & Background Jobs] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..

## When to use it
Write documentation for "Message Queues & Background Jobs". Cover: what it is, when to use it, the Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled. pitfall, and how to verify with Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Message Queues & Background Jobs. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (queue producer / worker / dead-letter handler / retry policy), the common failure pattern (Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.), the best practice (Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.), and the verification command (Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific queue producer / worker / dead-letter handler / retry policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document queue producer / worker / dead-letter handler / retry policy" — write a runbook with setup, usage, and troubleshooting.
- "Explain Message Queues & Background Jobs architecture" — produce an ADR covering Disable auto-ack.
__USB_SKILL_6BBA33B4B851F48A__

write_file "$PACK_DIR/skills/multi-tenant-isolation-explain.md" <<'__USB_SKILL_112A760859F8946A__'
---
description: "[Multi-Tenant Data Isolation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder."
slug: multi-tenant-isolation-explain
name: Multi-Tenant Data Isolation: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:multi-tenant-isolation, workflow:explain, docs, multi-tenant, saas, database
---

# Multi-Tenant Data Isolation: Explain

[Multi-Tenant Data Isolation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..

## When to use it
Write documentation for "Multi-Tenant Data Isolation". Cover: what it is, when to use it, the Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data. pitfall, and how to verify with RLS policy test with two different tenant sessions + data leakage check. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Multi-Tenant Data Isolation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (RLS policy / tenant context middleware / session variable injection / tenant-aware query builder), the common failure pattern (Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.), the best practice (Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.), and the verification command (RLS policy test with two different tenant sessions + data leakage check).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document RLS policy / tenant context middleware / session variable injection / tenant-aware query builder" — write a runbook with setup, usage, and troubleshooting.
- "Explain Multi-Tenant Data Isolation architecture" — produce an ADR covering Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable.
__USB_SKILL_112A760859F8946A__

write_file "$PACK_DIR/skills/nextjs-api-routes-explain.md" <<'__USB_SKILL_D1F3588733AA370A__'
---
description: "[Next.js API Routes & Route Handlers] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets route.ts handler / server action / API client wrapper / error boundary."
slug: nextjs-api-routes-explain
name: Next.js API Routes & Route Handlers: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-api-routes, workflow:explain, docs, nextjs, api, backend
---

# Next.js API Routes & Route Handlers: Explain

[Next.js API Routes & Route Handlers] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..

## When to use it
Write documentation for "Next.js API Routes & Route Handlers". Cover: what it is, when to use it, the Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component. pitfall, and how to verify with curl --verbose + API route error log + status code audit. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Next.js API Routes & Route Handlers. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (route.ts handler / server action / API client wrapper / error boundary), the common failure pattern (Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.), the best practice (All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.), and the verification command (curl --verbose + API route error log + status code audit).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific route.ts handler / server action / API client wrapper / error boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document route.ts handler / server action / API client wrapper / error boundary" — write a runbook with setup, usage, and troubleshooting.
- "Explain Next.js API Routes & Route Handlers architecture" — produce an ADR covering All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.
__USB_SKILL_D1F3588733AA370A__

write_file "$PACK_DIR/skills/nextjs-data-fetching-explain.md" <<'__USB_SKILL_D5EE3EB01741B65F__'
---
description: "[Next.js Data Fetching Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets server fetch / React cache wrapper / streaming suspense boundary."
slug: nextjs-data-fetching-explain
name: Next.js Data Fetching Patterns: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-data-fetching, workflow:explain, docs, nextjs, data-fetching, fullstack
---

# Next.js Data Fetching Patterns: Explain

[Next.js Data Fetching Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..

## When to use it
Write documentation for "Next.js Data Fetching Patterns". Cover: what it is, when to use it, the Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests. pitfall, and how to verify with next build --debug + React DevTools fetch profiling. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Next.js Data Fetching Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (server fetch / React cache wrapper / streaming suspense boundary), the common failure pattern (Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.), the best practice (Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.), and the verification command (next build --debug + React DevTools fetch profiling).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server fetch / React cache wrapper / streaming suspense boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document server fetch / React cache wrapper / streaming suspense boundary" — write a runbook with setup, usage, and troubleshooting.
- "Explain Next.js Data Fetching Patterns architecture" — produce an ADR covering Use server components for initial data fetch and pass down as props.
__USB_SKILL_D5EE3EB01741B65F__

write_file "$PACK_DIR/skills/nextjs-middleware-explain.md" <<'__USB_SKILL_B6CC57B353218966__'
---
description: "[Next.js Middleware & Edge Runtime] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing."
slug: nextjs-middleware-explain
name: Next.js Middleware & Edge Runtime: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-middleware, workflow:explain, docs, nextjs, middleware, edge
---

# Next.js Middleware & Edge Runtime: Explain

[Next.js Middleware & Edge Runtime] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..

## When to use it
Write documentation for "Next.js Middleware & Edge Runtime". Cover: what it is, when to use it, the Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes. pitfall, and how to verify with next dev + curl --cookie tests + edge runtime log inspection. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Next.js Middleware & Edge Runtime. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (middleware.ts / rewrite rule / cookie-based redirect / geolocation routing), the common failure pattern (Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.), the best practice (Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.), and the verification command (next dev + curl --cookie tests + edge runtime log inspection).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document middleware.ts / rewrite rule / cookie-based redirect / geolocation routing" — write a runbook with setup, usage, and troubleshooting.
- "Explain Next.js Middleware & Edge Runtime architecture" — produce an ADR covering Keep middleware stateless and light.
__USB_SKILL_B6CC57B353218966__

write_file "$PACK_DIR/skills/node-error-handling-explain.md" <<'__USB_SKILL_A3498B40EB2CEEF5__'
---
description: "[Node.js Error Handling & Resilience] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets global error handler / async wrapper / structured error response / retry logic."
slug: node-error-handling-explain
name: Node.js Error Handling & Resilience: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:node-error-handling, workflow:explain, docs, node, error-handling, backend
---

# Node.js Error Handling & Resilience: Explain

[Node.js Error Handling & Resilience] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..

## When to use it
Write documentation for "Node.js Error Handling & Resilience". Cover: what it is, when to use it, the Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context. pitfall, and how to verify with node --unhandled-rejections=strict + process.on('uncaughtException') log. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Node.js Error Handling & Resilience. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (global error handler / async wrapper / structured error response / retry logic), the common failure pattern (Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.), the best practice (Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.), and the verification command (node --unhandled-rejections=strict + process.on('uncaughtException') log).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific global error handler / async wrapper / structured error response / retry logic this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document global error handler / async wrapper / structured error response / retry logic" — write a runbook with setup, usage, and troubleshooting.
- "Explain Node.js Error Handling & Resilience architecture" — produce an ADR covering Use a global error handler for uncaught exceptions and unhandled rejections.
__USB_SKILL_A3498B40EB2CEEF5__

write_file "$PACK_DIR/skills/node-streams-explain.md" <<'__USB_SKILL_433B83460E73D28B__'
---
description: "[Node.js Streams & Backpressure] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Readable/Writable stream / Transform / pipeline() refactor."
slug: node-streams-explain
name: Node.js Streams & Backpressure: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:node-streams, workflow:explain, docs, node, streams, performance
---

# Node.js Streams & Backpressure: Explain

[Node.js Streams & Backpressure] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..

## When to use it
Write documentation for "Node.js Streams & Backpressure". Cover: what it is, when to use it, the Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams. pitfall, and how to verify with Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Node.js Streams & Backpressure. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (Readable/Writable stream / Transform / pipeline() refactor), the common failure pattern (Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.), the best practice (Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.), and the verification command (Node.js --inspect memory heap snapshot + stream highWaterMark tuning).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Readable/Writable stream / Transform / pipeline() refactor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document Readable/Writable stream / Transform / pipeline() refactor" — write a runbook with setup, usage, and troubleshooting.
- "Explain Node.js Streams & Backpressure architecture" — produce an ADR covering Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.
__USB_SKILL_433B83460E73D28B__

write_file "$PACK_DIR/skills/oauth-flows-explain.md" <<'__USB_SKILL_E42150AFD1D4342A__'
---
description: "[OAuth 2.0 Flows & Token Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler."
slug: oauth-flows-explain
name: OAuth 2.0 Flows & Token Management: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:oauth-flows, workflow:explain, docs, oauth, auth, security
---

# OAuth 2.0 Flows & Token Management: Explain

[OAuth 2.0 Flows & Token Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..

## When to use it
Write documentation for "OAuth 2.0 Flows & Token Management". Cover: what it is, when to use it, the Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation. pitfall, and how to verify with oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Output must be readable by both humans and AI agents.

## Protocol
You are documenting OAuth 2.0 Flows & Token Management. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (OAuth callback / token refresh / PKCE flow / httpOnly cookie handler), the common failure pattern (Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.), the best practice (Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.), and the verification command (oauth2_proxy + jwt.io debugger + curl --cookie with token inspection).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document OAuth callback / token refresh / PKCE flow / httpOnly cookie handler" — write a runbook with setup, usage, and troubleshooting.
- "Explain OAuth 2.0 Flows & Token Management architecture" — produce an ADR covering Store tokens in an httpOnly cookie set by the server, not in client-side storage.
__USB_SKILL_E42150AFD1D4342A__

write_file "$PACK_DIR/skills/openapi-spec-explain.md" <<'__USB_SKILL_356F8DC4F114670A__'
---
description: "[OpenAPI Specification & Validation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets openapi.yaml / code-first generator / request/response validation middleware."
slug: openapi-spec-explain
name: OpenAPI Specification & Validation: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:openapi-spec, workflow:explain, docs, openapi, api, contract
---

# OpenAPI Specification & Validation: Explain

[OpenAPI Specification & Validation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..

## When to use it
Write documentation for "OpenAPI Specification & Validation". Cover: what it is, when to use it, the Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code. pitfall, and how to verify with redocly lint + openapi-diff + swagger-ui preview. Output must be readable by both humans and AI agents.

## Protocol
You are documenting OpenAPI Specification & Validation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (openapi.yaml / code-first generator / request/response validation middleware), the common failure pattern (Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.), the best practice (Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.), and the verification command (redocly lint + openapi-diff + swagger-ui preview).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific openapi.yaml / code-first generator / request/response validation middleware this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document openapi.yaml / code-first generator / request/response validation middleware" — write a runbook with setup, usage, and troubleshooting.
- "Explain OpenAPI Specification & Validation architecture" — produce an ADR covering Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.
__USB_SKILL_356F8DC4F114670A__

write_file "$PACK_DIR/skills/playwright-selectors-explain.md" <<'__USB_SKILL_DA6F54AC5B5926F8__'
---
description: "[Playwright Selectors & Locators] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture."
slug: playwright-selectors-explain
name: Playwright Selectors & Locators: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:playwright-selectors, workflow:explain, docs, playwright, testing, e2e
---

# Playwright Selectors & Locators: Explain

[Playwright Selectors & Locators] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..

## When to use it
Write documentation for "Playwright Selectors & Locators". Cover: what it is, when to use it, the Using fragile CSS selectors (nth-child, class names that change) that break on every UI update. pitfall, and how to verify with playwright test --reporter=html + playwright codegen + trace viewer. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Playwright Selectors & Locators. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (locator refactor / test fixture / POM (Page Object Model) / custom fixture), the common failure pattern (Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.), the best practice (Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.), and the verification command (playwright test --reporter=html + playwright codegen + trace viewer).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document locator refactor / test fixture / POM (Page Object Model) / custom fixture" — write a runbook with setup, usage, and troubleshooting.
- "Explain Playwright Selectors & Locators architecture" — produce an ADR covering Use getByRole, getByText, or getByTestId with semantic naming.
__USB_SKILL_DA6F54AC5B5926F8__

write_file "$PACK_DIR/skills/prompt-injection-defense-explain.md" <<'__USB_SKILL_C8CE0A1000897F6E__'
---
description: "[Prompt Injection Defense] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator."
slug: prompt-injection-defense-explain
name: Prompt Injection Defense: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:prompt-injection-defense, workflow:explain, docs, prompt, security, llm
---

# Prompt Injection Defense: Explain

[Prompt Injection Defense] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..

## When to use it
Write documentation for "Prompt Injection Defense". Cover: what it is, when to use it, the Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'. pitfall, and how to verify with prompt injection test suite + adversarial input fuzzing + output scanner. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Prompt Injection Defense. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (defensive system prompt / input sanitizer / instruction guardrail / output validator), the common failure pattern (Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.), the best practice (Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.), and the verification command (prompt injection test suite + adversarial input fuzzing + output scanner).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document defensive system prompt / input sanitizer / instruction guardrail / output validator" — write a runbook with setup, usage, and troubleshooting.
- "Explain Prompt Injection Defense architecture" — produce an ADR covering Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.
__USB_SKILL_C8CE0A1000897F6E__

write_file "$PACK_DIR/skills/python-async-explain.md" <<'__USB_SKILL_C3ADE81FCAA72835__'
---
description: "[Python Async/Await Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets async/await refactor / asyncio.gather / async context manager."
slug: python-async-explain
name: Python Async/Await Patterns: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:python-async, workflow:explain, docs, python, async, performance
---

# Python Async/Await Patterns: Explain

[Python Async/Await Patterns] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..

## When to use it
Write documentation for "Python Async/Await Patterns". Cover: what it is, when to use it, the Blocking the event loop by using synchronous requests or time.sleep inside async functions. pitfall, and how to verify with python3 -m asyncio + aiohttp/httpx async benchmark. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Python Async/Await Patterns. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (async/await refactor / asyncio.gather / async context manager), the common failure pattern (Blocking the event loop by using synchronous requests or time.sleep inside async functions.), the best practice (Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.), and the verification command (python3 -m asyncio + aiohttp/httpx async benchmark).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific async/await refactor / asyncio.gather / async context manager this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document async/await refactor / asyncio.gather / async context manager" — write a runbook with setup, usage, and troubleshooting.
- "Explain Python Async/Await Patterns architecture" — produce an ADR covering Use httpx.
__USB_SKILL_C3ADE81FCAA72835__

write_file "$PACK_DIR/skills/python-file-io-explain.md" <<'__USB_SKILL_6BBD6D9944858F22__'
---
description: "[Python File I/O & Encoding] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets pathlib refactor / encoding-safe file reader / batch file processor."
slug: python-file-io-explain
name: Python File I/O & Encoding: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:python-file-io, workflow:explain, docs, python, file-io, scripting
---

# Python File I/O & Encoding: Explain

[Python File I/O & Encoding] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..

## When to use it
Write documentation for "Python File I/O & Encoding". Cover: what it is, when to use it, the Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content. pitfall, and how to verify with python3 -c with open() + chardet encoding detection. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Python File I/O & Encoding. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (pathlib refactor / encoding-safe file reader / batch file processor), the common failure pattern (Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.), the best practice (Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.), and the verification command (python3 -c with open() + chardet encoding detection).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document pathlib refactor / encoding-safe file reader / batch file processor" — write a runbook with setup, usage, and troubleshooting.
- "Explain Python File I/O & Encoding architecture" — produce an ADR covering Always specify encoding explicitly when opening text files.
__USB_SKILL_6BBD6D9944858F22__

write_file "$PACK_DIR/skills/rag-chunking-explain.md" <<'__USB_SKILL_D8BC07EABE1B5C6D__'
---
description: "[RAG Chunking Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment."
slug: rag-chunking-explain
name: RAG Chunking Strategies: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:rag-chunking, workflow:explain, docs, rag, chunking, retrieval
---

# RAG Chunking Strategies: Explain

[RAG Chunking Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..

## When to use it
Write documentation for "RAG Chunking Strategies". Cover: what it is, when to use it, the Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality. pitfall, and how to verify with retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Output must be readable by both humans and AI agents.

## Protocol
You are documenting RAG Chunking Strategies. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment), the common failure pattern (Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.), the best practice (Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.), and the verification command (retrieval evaluation script + chunk boundary visualisation + recall@k measurement).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment" — write a runbook with setup, usage, and troubleshooting.
- "Explain RAG Chunking Strategies architecture" — produce an ADR covering Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries.
__USB_SKILL_D8BC07EABE1B5C6D__

write_file "$PACK_DIR/skills/rate-limiting-proxy-explain.md" <<'__USB_SKILL_FD5127E2A1F14865__'
---
description: "[Rate Limiting & API Gateway Proxy] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation."
slug: rate-limiting-proxy-explain
name: Rate Limiting & API Gateway Proxy: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:rate-limiting-proxy, workflow:explain, docs, rate-limiting, proxy, security
---

# Rate Limiting & API Gateway Proxy: Explain

[Rate Limiting & API Gateway Proxy] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..

## When to use it
Write documentation for "Rate Limiting & API Gateway Proxy". Cover: what it is, when to use it, the Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources. pitfall, and how to verify with ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Rate Limiting & API Gateway Proxy. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation), the common failure pattern (Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.), the best practice (Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.), and the verification command (ab -n 1000 -c 10 + nginx error log + 429 response code monitoring).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation" — write a runbook with setup, usage, and troubleshooting.
- "Explain Rate Limiting & API Gateway Proxy architecture" — produce an ADR covering Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.
__USB_SKILL_FD5127E2A1F14865__

write_file "$PACK_DIR/skills/react-server-components-explain.md" <<'__USB_SKILL_2D727D86E208901C__'
---
description: "[React Server Components] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets server component / client boundary refactor / streaming fallback."
slug: react-server-components-explain
name: React Server Components: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:react-server-components, workflow:explain, docs, react, rsc, frontend
---

# React Server Components: Explain

[React Server Components] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..

## When to use it
Write documentation for "React Server Components". Cover: what it is, when to use it, the Accidentally making a server component a client component by using hooks or event handlers in the wrong file. pitfall, and how to verify with next build --debug + React Server Components lint rule. Output must be readable by both humans and AI agents.

## Protocol
You are documenting React Server Components. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (server component / client boundary refactor / streaming fallback), the common failure pattern (Accidentally making a server component a client component by using hooks or event handlers in the wrong file.), the best practice (Keep data fetching and heavy logic in server components; pass results as props to client islands.), and the verification command (next build --debug + React Server Components lint rule).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server component / client boundary refactor / streaming fallback this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document server component / client boundary refactor / streaming fallback" — write a runbook with setup, usage, and troubleshooting.
- "Explain React Server Components architecture" — produce an ADR covering Keep data fetching and heavy logic in server components; pass results as props to client islands.
__USB_SKILL_2D727D86E208901C__

write_file "$PACK_DIR/skills/react-state-explain.md" <<'__USB_SKILL_068D6695A65A116E__'
---
description: "[React State Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice."
slug: react-state-explain
name: React State Management: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:react-state, workflow:explain, docs, react, state, frontend
---

# React State Management: Explain

[React State Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..

## When to use it
Write documentation for "React State Management". Cover: what it is, when to use it, the Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation. pitfall, and how to verify with React DevTools profiler + why-did-you-render. Output must be readable by both humans and AI agents.

## Protocol
You are documenting React State Management. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (useState / useReducer / useContext hook refactor, zustand or jotai store slice), the common failure pattern (Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.), the best practice (Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.), and the verification command (React DevTools profiler + why-did-you-render).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document useState / useReducer / useContext hook refactor, zustand or jotai store slice" — write a runbook with setup, usage, and troubleshooting.
- "Explain React State Management architecture" — produce an ADR covering Co-locate state as close to the consuming component as possible.
__USB_SKILL_068D6695A65A116E__

write_file "$PACK_DIR/skills/redis-caching-explain.md" <<'__USB_SKILL_BC4ADDE4B74A3E97__'
---
description: "[Redis Caching Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy."
slug: redis-caching-explain
name: Redis Caching Strategies: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:redis-caching, workflow:explain, docs, redis, caching, performance
---

# Redis Caching Strategies: Explain

[Redis Caching Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..

## When to use it
Write documentation for "Redis Caching Strategies". Cover: what it is, when to use it, the Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time. pitfall, and how to verify with redis-cli --stat + cache hit ratio monitoring + slow log. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Redis Caching Strategies. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (cache wrapper / mutex lock / stale-while-revalidate / TTL policy), the common failure pattern (Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.), the best practice (Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.), and the verification command (redis-cli --stat + cache hit ratio monitoring + slow log).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document cache wrapper / mutex lock / stale-while-revalidate / TTL policy" — write a runbook with setup, usage, and troubleshooting.
- "Explain Redis Caching Strategies architecture" — produce an ADR covering Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.
__USB_SKILL_BC4ADDE4B74A3E97__

write_file "$PACK_DIR/skills/rest-pagination-explain.md" <<'__USB_SKILL_D7B8ED9D41D112C5__'
---
description: "[REST Pagination Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope."
slug: rest-pagination-explain
name: REST Pagination Design: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:rest-pagination, workflow:explain, docs, rest, pagination, api
---

# REST Pagination Design: Explain

[REST Pagination Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..

## When to use it
Write documentation for "REST Pagination Design". Cover: what it is, when to use it, the Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows. pitfall, and how to verify with curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Output must be readable by both humans and AI agents.

## Protocol
You are documenting REST Pagination Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (cursor pagination / offset pagination fallback / total count optimisation / response envelope), the common failure pattern (Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.), the best practice (Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.), and the verification command (curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document cursor pagination / offset pagination fallback / total count optimisation / response envelope" — write a runbook with setup, usage, and troubleshooting.
- "Explain REST Pagination Design architecture" — produce an ADR covering Use cursor-based pagination (keyset pagination) for large datasets.
__USB_SKILL_D7B8ED9D41D112C5__

write_file "$PACK_DIR/skills/secrets-rotation-explain.md" <<'__USB_SKILL_2E574DA6FD7EB038__'
---
description: "[Secrets Rotation Policy] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets rotation script / vault integration / lease management / incident response plan."
slug: secrets-rotation-explain
name: Secrets Rotation Policy: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:secrets-rotation, workflow:explain, docs, secrets, security, rotation
---

# Secrets Rotation Policy: Explain

[Secrets Rotation Policy] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..

## When to use it
Write documentation for "Secrets Rotation Policy". Cover: what it is, when to use it, the Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak. pitfall, and how to verify with vault lease list + secret expiry check + rotation dry-run test. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Secrets Rotation Policy. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (rotation script / vault integration / lease management / incident response plan), the common failure pattern (Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.), the best practice (Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.), and the verification command (vault lease list + secret expiry check + rotation dry-run test).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific rotation script / vault integration / lease management / incident response plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document rotation script / vault integration / lease management / incident response plan" — write a runbook with setup, usage, and troubleshooting.
- "Explain Secrets Rotation Policy architecture" — produce an ADR covering Automate secret rotation with a scheduled job.
__USB_SKILL_2E574DA6FD7EB038__

write_file "$PACK_DIR/skills/shell-script-robustness-explain.md" <<'__USB_SKILL_5F435CBEED139721__'
---
description: "[Shell Script Robustness & Safety] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function."
slug: shell-script-robustness-explain
name: Shell Script Robustness & Safety: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:shell-script-robustness, workflow:explain, docs, shell, scripting, safety
---

# Shell Script Robustness & Safety: Explain

[Shell Script Robustness & Safety] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..

## When to use it
Write documentation for "Shell Script Robustness & Safety". Cover: what it is, when to use it, the Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage. pitfall, and how to verify with shellcheck script.sh + bash -n script.sh + dry-run mode test. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Shell Script Robustness & Safety. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function), the common failure pattern (Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.), the best practice (Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.), and the verification command (shellcheck script.sh + bash -n script.sh + dry-run mode test).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function" — write a runbook with setup, usage, and troubleshooting.
- "Explain Shell Script Robustness & Safety architecture" — produce an ADR covering Always start scripts with 'set -euo pipefail'.
__USB_SKILL_5F435CBEED139721__

write_file "$PACK_DIR/skills/sql-query-optimization-explain.md" <<'__USB_SKILL_7E9EA74B82CFCB28__'
---
description: "[SQL Query Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index."
slug: sql-query-optimization-explain
name: SQL Query Optimisation: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:sql-query-optimization, workflow:explain, docs, sql, optimization, database
---

# SQL Query Optimisation: Explain

[SQL Query Optimisation] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..

## When to use it
Write documentation for "SQL Query Optimisation". Cover: what it is, when to use it, the Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs. pitfall, and how to verify with EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Output must be readable by both humans and AI agents.

## Protocol
You are documenting SQL Query Optimisation. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (indexed query / composite index / EXPLAIN ANALYSE plan / partial index), the common failure pattern (Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.), the best practice (Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.), and the verification command (EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document indexed query / composite index / EXPLAIN ANALYSE plan / partial index" — write a runbook with setup, usage, and troubleshooting.
- "Explain SQL Query Optimisation architecture" — produce an ADR covering Always select only the columns you need.
__USB_SKILL_7E9EA74B82CFCB28__

write_file "$PACK_DIR/skills/stealth-web-research-explain.md" <<'__USB_SKILL_98A11854D4881BFE__'
---
description: "[Stealth Web Research & Harvesting] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages."
slug: stealth-web-research-explain
name: Stealth Web Research & Harvesting: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:stealth-web-research, workflow:explain, docs, stealth, scraping, research, anti-bot
---

# Stealth Web Research & Harvesting: Explain

[Stealth Web Research & Harvesting] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..

## When to use it
Write documentation for "Stealth Web Research & Harvesting". Cover: what it is, when to use it, the Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests. pitfall, and how to verify with playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Stealth Web Research & Harvesting. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages), the common failure pattern (Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.), the best practice (Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.), and the verification command (playwright-extra + stealth + cheerio + defuddle + manual jq inspection).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages" — write a runbook with setup, usage, and troubleshooting.
- "Explain Stealth Web Research & Harvesting architecture" — produce an ADR covering Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin).
__USB_SKILL_98A11854D4881BFE__

write_file "$PACK_DIR/skills/stripe-webhook-idempotency-explain.md" <<'__USB_SKILL_646ED81D01FF459F__'
---
description: "[Stripe Webhook Idempotency] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery."
slug: stripe-webhook-idempotency-explain
name: Stripe Webhook Idempotency: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:stripe-webhook-idempotency, workflow:explain, docs, stripe, webhook, payments
---

# Stripe Webhook Idempotency: Explain

[Stripe Webhook Idempotency] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..

## When to use it
Write documentation for "Stripe Webhook Idempotency". Cover: what it is, when to use it, the Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations. pitfall, and how to verify with stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Stripe Webhook Idempotency. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (Webhook handler / idempotency key check / event deduplication / failed payment recovery), the common failure pattern (Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.), the best practice (Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.), and the verification command (stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document Webhook handler / idempotency key check / event deduplication / failed payment recovery" — write a runbook with setup, usage, and troubleshooting.
- "Explain Stripe Webhook Idempotency architecture" — produce an ADR covering Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.
__USB_SKILL_646ED81D01FF459F__

write_file "$PACK_DIR/skills/supabase-rls-explain.md" <<'__USB_SKILL_E1E01202567FA19D__'
---
description: "[Supabase Row-Level Security] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets RLS policy / policy test / security definer function / admin bypass."
slug: supabase-rls-explain
name: Supabase Row-Level Security: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:supabase-rls, workflow:explain, docs, supabase, rls, security
---

# Supabase Row-Level Security: Explain

[Supabase Row-Level Security] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..

## When to use it
Write documentation for "Supabase Row-Level Security". Cover: what it is, when to use it, the RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data. pitfall, and how to verify with supabase db check + supabase db test + RLS policy review with pg_policies. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Supabase Row-Level Security. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (RLS policy / policy test / security definer function / admin bypass), the common failure pattern (RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.), the best practice (Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.), and the verification command (supabase db check + supabase db test + RLS policy review with pg_policies).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / policy test / security definer function / admin bypass this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document RLS policy / policy test / security definer function / admin bypass" — write a runbook with setup, usage, and troubleshooting.
- "Explain Supabase Row-Level Security architecture" — produce an ADR covering Always reference auth.
__USB_SKILL_E1E01202567FA19D__

write_file "$PACK_DIR/skills/terraform-state-explain.md" <<'__USB_SKILL_0F2F19DBB93FA295__'
---
description: "[Terraform State Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets backend config / state migration plan / state locking config / remote state datasource."
slug: terraform-state-explain
name: Terraform State Management: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:terraform-state, workflow:explain, docs, terraform, state, iac
---

# Terraform State Management: Explain

[Terraform State Management] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..

## When to use it
Write documentation for "Terraform State Management". Cover: what it is, when to use it, the Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure. pitfall, and how to verify with terraform plan + terraform state list + terraform state pull | jq. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Terraform State Management. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (backend config / state migration plan / state locking config / remote state datasource), the common failure pattern (Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.), the best practice (Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.), and the verification command (terraform plan + terraform state list + terraform state pull | jq).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific backend config / state migration plan / state locking config / remote state datasource this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document backend config / state migration plan / state locking config / remote state datasource" — write a runbook with setup, usage, and troubleshooting.
- "Explain Terraform State Management architecture" — produce an ADR covering Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.
__USB_SKILL_0F2F19DBB93FA295__

write_file "$PACK_DIR/skills/typescript-generics-explain.md" <<'__USB_SKILL_1470C917E5A2E6D9__'
---
description: "[TypeScript Generics & Advanced Types] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets generic type / conditional type / mapped type / branded type."
slug: typescript-generics-explain
name: TypeScript Generics & Advanced Types: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:typescript-generics, workflow:explain, docs, typescript, generics, type-system
---

# TypeScript Generics & Advanced Types: Explain

[TypeScript Generics & Advanced Types] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..

## When to use it
Write documentation for "TypeScript Generics & Advanced Types". Cover: what it is, when to use it, the Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice). pitfall, and how to verify with tsc --noEmit --strict + type tests with expect-type. Output must be readable by both humans and AI agents.

## Protocol
You are documenting TypeScript Generics & Advanced Types. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (generic type / conditional type / mapped type / branded type), the common failure pattern (Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).), the best practice (Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.), and the verification command (tsc --noEmit --strict + type tests with expect-type).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific generic type / conditional type / mapped type / branded type this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document generic type / conditional type / mapped type / branded type" — write a runbook with setup, usage, and troubleshooting.
- "Explain TypeScript Generics & Advanced Types architecture" — produce an ADR covering Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.
__USB_SKILL_1470C917E5A2E6D9__

write_file "$PACK_DIR/skills/user-onboarding-flow-explain.md" <<'__USB_SKILL_98D887DBE708049A__'
---
description: "[User Onboarding Flow Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec."
slug: user-onboarding-flow-explain
name: User Onboarding Flow Design: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:user-onboarding-flow, workflow:explain, docs, ux, onboarding, product
---

# User Onboarding Flow Design: Explain

[User Onboarding Flow Design] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..

## When to use it
Write documentation for "User Onboarding Flow Design". Cover: what it is, when to use it, the Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value. pitfall, and how to verify with analytics funnel analysis + onboarding completion rate + drop-off heatmap. Output must be readable by both humans and AI agents.

## Protocol
You are documenting User Onboarding Flow Design. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (onboarding wizard / feature checklist / in-app guide / first-run experience spec), the common failure pattern (Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.), the best practice (Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.), and the verification command (analytics funnel analysis + onboarding completion rate + drop-off heatmap).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document onboarding wizard / feature checklist / in-app guide / first-run experience spec" — write a runbook with setup, usage, and troubleshooting.
- "Explain User Onboarding Flow Design architecture" — produce an ADR covering Use progressive disclosure: only introduce features when the user reaches the point where they need them.
__USB_SKILL_98D887DBE708049A__

write_file "$PACK_DIR/skills/vercel-env-vars-explain.md" <<'__USB_SKILL_8421324BF5F37F74__'
---
description: "[Vercel Environment Variables] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets vercel.json env group / preview env config / Edge Config / KV store."
slug: vercel-env-vars-explain
name: Vercel Environment Variables: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:vercel-env-vars, workflow:explain, docs, vercel, env, deployment
---

# Vercel Environment Variables: Explain

[Vercel Environment Variables] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..

## When to use it
Write documentation for "Vercel Environment Variables". Cover: what it is, when to use it, the Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments. pitfall, and how to verify with vercel env pull + vercel list + project settings audit. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Vercel Environment Variables. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (vercel.json env group / preview env config / Edge Config / KV store), the common failure pattern (Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.), the best practice (Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.), and the verification command (vercel env pull + vercel list + project settings audit).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific vercel.json env group / preview env config / Edge Config / KV store this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document vercel.json env group / preview env config / Edge Config / KV store" — write a runbook with setup, usage, and troubleshooting.
- "Explain Vercel Environment Variables architecture" — produce an ADR covering Use separate environment groups for production, preview, and development.
__USB_SKILL_8421324BF5F37F74__

write_file "$PACK_DIR/skills/web-scraping-ethics-explain.md" <<'__USB_SKILL_D664BC3CE02FADAE__'
---
description: "[Web Scraping Ethics & Compliance] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper."
slug: web-scraping-ethics-explain
name: Web Scraping Ethics & Compliance: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:web-scraping-ethics, workflow:explain, docs, scraping, ethics, research
---

# Web Scraping Ethics & Compliance: Explain

[Web Scraping Ethics & Compliance] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..

## When to use it
Write documentation for "Web Scraping Ethics & Compliance". Cover: what it is, when to use it, the Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues. pitfall, and how to verify with curl robots.txt + wget --wait + scraper log audit. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Web Scraping Ethics & Compliance. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (robots.txt check / polite scraper / rate-limited crawler / cached scraper), the common failure pattern (Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.), the best practice (Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.), and the verification command (curl robots.txt + wget --wait + scraper log audit).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document robots.txt check / polite scraper / rate-limited crawler / cached scraper" — write a runbook with setup, usage, and troubleshooting.
- "Explain Web Scraping Ethics & Compliance architecture" — produce an ADR covering Always check robots.
__USB_SKILL_D664BC3CE02FADAE__

write_file "$PACK_DIR/skills/websocket-reconnection-explain.md" <<'__USB_SKILL_378C83F41F1B604E__'
---
description: "[WebSocket Reconnection Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets WebSocket client / reconnection logic / heartbeat / connection status component."
slug: websocket-reconnection-explain
name: WebSocket Reconnection Strategies: Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:websocket-reconnection, workflow:explain, docs, websocket, realtime, frontend
---

# WebSocket Reconnection Strategies: Explain

[WebSocket Reconnection Strategies] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..

## When to use it
Write documentation for "WebSocket Reconnection Strategies". Cover: what it is, when to use it, the Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state. pitfall, and how to verify with Browser DevTools Network tab WS filter + reconnection test with server restart. Output must be readable by both humans and AI agents.

## Protocol
You are documenting WebSocket Reconnection Strategies. Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (WebSocket client / reconnection logic / heartbeat / connection status component), the common failure pattern (Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.), the best practice (Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.), and the verification command (Browser DevTools Network tab WS filter + reconnection test with server restart).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document WebSocket client / reconnection logic / heartbeat / connection status component" — write a runbook with setup, usage, and troubleshooting.
- "Explain WebSocket Reconnection Strategies architecture" — produce an ADR covering Implement exponential backoff reconnection with a maximum delay of 30 seconds.
__USB_SKILL_378C83F41F1B604E__

write_file "$PACK_DIR/skills/web-vitals-optimization-explain.md" <<'__USB_SKILL_7C7D17E79ADFBC97__'
---
description: "[Web Vitals Optimisation (LCP/CLS/INP)] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis."
slug: web-vitals-optimization-explain
name: Web Vitals Optimisation (LCP/CLS/INP): Explain
category: Docs
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:web-vitals-optimization, workflow:explain, docs, performance, web-vitals, optimisation
---

# Web Vitals Optimisation (LCP/CLS/INP): Explain

[Web Vitals Optimisation (LCP/CLS/INP)] Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..

## When to use it
Write documentation for "Web Vitals Optimisation (LCP/CLS/INP)". Cover: what it is, when to use it, the Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions). pitfall, and how to verify with Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Output must be readable by both humans and AI agents.

## Protocol
You are documenting Web Vitals Optimisation (LCP/CLS/INP). Write clear, structured documentation: README sections, architecture decision records, API reference docs, or runbooks. The audience is another developer or an AI agent. Include setup steps, usage examples, and a troubleshooting section.. Cover: the purpose, the output (image optimisation / font display swap / critical CSS / lazy load / bundle analysis), the common failure pattern (Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).), the best practice (Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.), and the verification command (Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Document image optimisation / font display swap / critical CSS / lazy load / bundle analysis" — write a runbook with setup, usage, and troubleshooting.
- "Explain Web Vitals Optimisation (LCP/CLS/INP) architecture" — produce an ADR covering Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images.
__USB_SKILL_7C7D17E79ADFBC97__

write_file "$PACK_DIR/skills/context-window-budget-explain.md" <<'__USB_SKILL_0BB121D18FFB5E41__'
---
description: "[LLM Context Window Budget Management] Document the domain: purpose, output, common failure, best practice, verification command Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard."
slug: context-window-budget-explain
name: LLM Context Window Budget Management: Explain
category: Documentation
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:context-window-budget, workflow:explain, documentation, context, tokens, llm, memory, summarization
---

# LLM Context Window Budget Management: Explain

[LLM Context Window Budget Management] Document the domain: purpose, output, common failure, best practice, verification command Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..

## When to use it
Write documentation for "LLM Context Window Budget Management". Cover: what it is, when to use it, the Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness. pitfall, and how to verify with tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Output must be readable by both humans and AI agents.

## Protocol
You are documenting LLM Context Window Budget Management. Document the domain: purpose, output, common failure, best practice, verification command. Cover: the purpose, the output (trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard), the common failure pattern (Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.), the best practice (Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.), and the verification command (tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry).

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves.

## Output contract
- **md** (markdown): MD output

## Examples
- "Document trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard" — write a runbook with setup, usage, and troubleshooting.
- "Explain LLM Context Window Budget Management architecture" — produce an ADR covering Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary.
__USB_SKILL_0BB121D18FFB5E41__

write_file "$PACK_DIR/skills/codebase-navigator.md" <<'__USB_SKILL_5A236472431022A0__'
---
description: "Scans a repository to identify the files relevant to a given goal, maps dependency relationships, and produces a minimal-change plan. Reduces the risk of unintended side-effects by flagging shared modules. Call this before writing any code in an unfamiliar repository or before modifying a system you have not fully explored."
slug: codebase-navigator
name: Codebase Navigator
category: Engineering
risk: low
model_agnostic: true
agent_agnostic: true
tags: exploration, impact-analysis, repo-mapping
---

# Codebase Navigator

Scans a repository to identify the files relevant to a given goal, maps dependency relationships, and produces a minimal-change plan. Reduces the risk of unintended side-effects by flagging shared modules.

## When to use it
Call this before writing any code in an unfamiliar repository or before modifying a system you have not fully explored.

## Protocol
List the project's top-level directory structure. For each directory, summarise its purpose based on file names and imports. Identify the files most likely related to the user's goal. Map their import/export dependencies. Highlight potential side-effect files (shared utilities, common types, global config). Produce a minimal set of files to modify, ordered by dependency. Flag any files that are safe to edit versus those that need cautious amendment.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **fileMap** (json, optional): Directory tree or search results from repository exploration.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- In a Next.js monorepo with shared ui-library, identify the specific page, layout, component, and API route that need changes for a new settings page.
- In a Python monorepo with multiple services, trace the import chain from a CLI entry point to the database layer.
__USB_SKILL_5A236472431022A0__

write_file "$PACK_DIR/skills/implementation-sprint.md" <<'__USB_SKILL_FA93A4DA69914373__'
---
description: "Turns a plan into small, independently verifiable code patches. Each patch includes a clear purpose, file list, expected behaviour change, and a validation command. Dependencies are resolved first; UI and polish come last. Call this after a plan is approved and you are ready to start writing or editing code."
slug: implementation-sprint
name: Implementation Sprint
category: Engineering
risk: medium
model_agnostic: true
agent_agnostic: true
tags: implementation, patch, incremental
---

# Implementation Sprint

Turns a plan into small, independently verifiable code patches. Each patch includes a clear purpose, file list, expected behaviour change, and a validation command. Dependencies are resolved first; UI and polish come last.

## When to use it
Call this after a plan is approved and you are ready to start writing or editing code.

## Protocol
Divide the approved plan into patches of no more than 3 files each. For each patch: state the purpose, list the files, describe the expected behavioural change, and provide a verification command (lint, type-check, unit-test, or manual curl). Order patches by dependency: foundation first (types, schema), then logic (services, hooks), then binding (API, state), then presentation (UI), then polish (styles, comments). After each patch, run its verification command before proceeding.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- Patch 1: define Prisma/Drizzle schema for 'team' table → run 'npx drizzle-kit push'. Patch 2: create CRUD API routes for teams → run 'curl each endpoint'. Patch 3: build team management UI → run 'npm run build'.
- Patch 1: add TypeScript types for new feature flag. Patch 2: implement feature flag service with tests. Patch 3: integrate flag into existing UI component.
__USB_SKILL_FA93A4DA69914373__

write_file "$PACK_DIR/skills/a-b-testing-framework-build.md" <<'__USB_SKILL_9A14085697E52E2B__'
---
description: "[A/B Testing Framework] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets experiment spec / variant assignment / metric definition / statistical analysis script."
slug: a-b-testing-framework-build
name: A/B Testing Framework: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:a-b-testing-framework, workflow:build, implementation, ab-testing, experiments, product
---

# A/B Testing Framework: Build

[A/B Testing Framework] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..

## When to use it
Write or modify code for "A/B Testing Framework". The typical output is experiment spec / variant assignment / metric definition / statistical analysis script. Keep the best practice in mind: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Verify with: statsmodels sample size calculation + Bayesian A/B test + sequential testing.

## Protocol
You are implementing a change for A/B Testing Framework. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is experiment spec / variant assignment / metric definition / statistical analysis script. Follow the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Run statsmodels sample size calculation + Bayesian A/B test + sequential testing after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement experiment spec / variant assignment / metric definition / statistical analysis script" — write patches in the correct dependency order, verified with statsmodels sample size calculation.
- "Add A/B Testing Framework support" — build incrementally, each step independently testable.
__USB_SKILL_9A14085697E52E2B__

write_file "$PACK_DIR/skills/a11y-aria-patterns-build.md" <<'__USB_SKILL_DB295D5F943333C4__'
---
description: "[Accessibility ARIA Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script."
slug: a11y-aria-patterns-build
name: Accessibility ARIA Patterns: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:a11y-aria-patterns, workflow:build, implementation, accessibility, aria, testing
---

# Accessibility ARIA Patterns: Build

[Accessibility ARIA Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..

## When to use it
Write or modify code for "Accessibility ARIA Patterns". The typical output is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Keep the best practice in mind: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Verify with: axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit.

## Protocol
You are implementing a change for Accessibility ARIA Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Follow the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Run axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement ARIA attribute refactor / keyboard navigation / focus management / screen reader test script" — write patches in the correct dependency order, verified with axe-core.
- "Add Accessibility ARIA Patterns support" — build incrementally, each step independently testable.
__USB_SKILL_DB295D5F943333C4__

write_file "$PACK_DIR/skills/agent-tool-binding-build.md" <<'__USB_SKILL_E6B77A4288C16D03__'
---
description: "[Agent Tool Binding & Dispatch] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets router tool / domain group / dynamic tool injection / tool usage statistics."
slug: agent-tool-binding-build
name: Agent Tool Binding & Dispatch: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:agent-tool-binding, workflow:build, implementation, agents, tool-binding, orchestration
---

# Agent Tool Binding & Dispatch: Build

[Agent Tool Binding & Dispatch] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..

## When to use it
Write or modify code for "Agent Tool Binding & Dispatch". The typical output is router tool / domain group / dynamic tool injection / tool usage statistics. Keep the best practice in mind: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Verify with: agent trace log + tool invocation frequency analysis + token cost audit.

## Protocol
You are implementing a change for Agent Tool Binding & Dispatch. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is router tool / domain group / dynamic tool injection / tool usage statistics. Follow the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Run agent trace log + tool invocation frequency analysis + token cost audit after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement router tool / domain group / dynamic tool injection / tool usage statistics" — write patches in the correct dependency order, verified with agent trace log.
- "Add Agent Tool Binding & Dispatch support" — build incrementally, each step independently testable.
__USB_SKILL_E6B77A4288C16D03__

write_file "$PACK_DIR/skills/analytics-metric-definition-build.md" <<'__USB_SKILL_9AA856DDEC78BEFC__'
---
description: "[Analytics Metric Definitions] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation."
slug: analytics-metric-definition-build
name: Analytics Metric Definitions: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:analytics-metric-definition, workflow:build, implementation, analytics, metrics, data
---

# Analytics Metric Definitions: Build

[Analytics Metric Definitions] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..

## When to use it
Write or modify code for "Analytics Metric Definitions". The typical output is metric definition / dbt model / SQL logic / dashboard tile / documentation. Keep the best practice in mind: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Verify with: dbt docs generate + dbt test --select tag:metrics + metric comparison script.

## Protocol
You are implementing a change for Analytics Metric Definitions. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is metric definition / dbt model / SQL logic / dashboard tile / documentation. Follow the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Run dbt docs generate + dbt test --select tag:metrics + metric comparison script after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement metric definition / dbt model / SQL logic / dashboard tile / documentation" — write patches in the correct dependency order, verified with dbt docs generate.
- "Add Analytics Metric Definitions support" — build incrementally, each step independently testable.
__USB_SKILL_9AA856DDEC78BEFC__

write_file "$PACK_DIR/skills/adr-documentation-build.md" <<'__USB_SKILL_0E48C4D04B6EFCC2__'
---
description: "[Architecture Decision Records] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets ADR document / decision log / template / review workflow."
slug: adr-documentation-build
name: Architecture Decision Records: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:adr-documentation, workflow:build, implementation, documentation, adr, architecture
---

# Architecture Decision Records: Build

[Architecture Decision Records] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..

## When to use it
Write or modify code for "Architecture Decision Records". The typical output is ADR document / decision log / template / review workflow. Keep the best practice in mind: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Verify with: adr-tools list + adr-tools generate + decision log index page.

## Protocol
You are implementing a change for Architecture Decision Records. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is ADR document / decision log / template / review workflow. Follow the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Run adr-tools list + adr-tools generate + decision log index page after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ADR document / decision log / template / review workflow this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement ADR document / decision log / template / review workflow" — write patches in the correct dependency order, verified with adr-tools list.
- "Add Architecture Decision Records support" — build incrementally, each step independently testable.
__USB_SKILL_0E48C4D04B6EFCC2__

write_file "$PACK_DIR/skills/aws-lambda-cold-start-build.md" <<'__USB_SKILL_37D8CEE8E5CF4435__'
---
description: "[AWS Lambda Cold Starts] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function."
slug: aws-lambda-cold-start-build
name: AWS Lambda Cold Starts: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:aws-lambda-cold-start, workflow:build, implementation, aws, lambda, performance
---

# AWS Lambda Cold Starts: Build

[AWS Lambda Cold Starts] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..

## When to use it
Write or modify code for "AWS Lambda Cold Starts". The typical output is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Keep the best practice in mind: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Verify with: AWS X-Ray trace + Lambda Insights + cold start dashboard.

## Protocol
You are implementing a change for AWS Lambda Cold Starts. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Follow the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Run AWS X-Ray trace + Lambda Insights + cold start dashboard after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement handler refactor / SnapStart config / Provisioned Concurrency / warmer function" — write patches in the correct dependency order, verified with AWS X-Ray trace.
- "Add AWS Lambda Cold Starts support" — build incrementally, each step independently testable.
__USB_SKILL_37D8CEE8E5CF4435__

write_file "$PACK_DIR/skills/azure-bicep-build.md" <<'__USB_SKILL_EF0665413B2973DD__'
---
description: "[Azure Bicep Infrastructure] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets main.bicep / module / parameter file / azd template."
slug: azure-bicep-build
name: Azure Bicep Infrastructure: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:azure-bicep, workflow:build, implementation, azure, bicep, iac
---

# Azure Bicep Infrastructure: Build

[Azure Bicep Infrastructure] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..

## When to use it
Write or modify code for "Azure Bicep Infrastructure". The typical output is main.bicep / module / parameter file / azd template. Keep the best practice in mind: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Verify with: az deployment group validate + az what-if + bicep build.

## Protocol
You are implementing a change for Azure Bicep Infrastructure. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is main.bicep / module / parameter file / azd template. Follow the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Run az deployment group validate + az what-if + bicep build after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific main.bicep / module / parameter file / azd template this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement main.bicep / module / parameter file / azd template" — write patches in the correct dependency order, verified with az deployment group validate.
- "Add Azure Bicep Infrastructure support" — build incrementally, each step independently testable.
__USB_SKILL_EF0665413B2973DD__

write_file "$PACK_DIR/skills/browser-devtools-build.md" <<'__USB_SKILL_62CE6E3F61547388__'
---
description: "[Browser DevTools & Debugging] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot."
slug: browser-devtools-build
name: Browser DevTools & Debugging: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:browser-devtools, workflow:build, implementation, browser, debugging, devtools
---

# Browser DevTools & Debugging: Build

[Browser DevTools & Debugging] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..

## When to use it
Write or modify code for "Browser DevTools & Debugging". The typical output is debugging workflow / breakpoint guide / performance recording / memory snapshot. Keep the best practice in mind: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Verify with: Chrome DevTools performance recording + memory heap snapshot + network throttle.

## Protocol
You are implementing a change for Browser DevTools & Debugging. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is debugging workflow / breakpoint guide / performance recording / memory snapshot. Follow the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Run Chrome DevTools performance recording + memory heap snapshot + network throttle after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement debugging workflow / breakpoint guide / performance recording / memory snapshot" — write patches in the correct dependency order, verified with Chrome DevTools performance recording.
- "Add Browser DevTools & Debugging support" — build incrementally, each step independently testable.
__USB_SKILL_62CE6E3F61547388__

write_file "$PACK_DIR/skills/cli-tool-design-build.md" <<'__USB_SKILL_14DF257CBF218A85__'
---
description: "[CLI Tool Design Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CLI scaffolding / argument parser / exit code handler / --json output mode."
slug: cli-tool-design-build
name: CLI Tool Design Patterns: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cli-tool-design, workflow:build, implementation, cli, devtools, scripting
---

# CLI Tool Design Patterns: Build

[CLI Tool Design Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..

## When to use it
Write or modify code for "CLI Tool Design Patterns". The typical output is CLI scaffolding / argument parser / exit code handler / --json output mode. Keep the best practice in mind: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Verify with: echo $? after CLI run + stderr redirection test + --json output validation.

## Protocol
You are implementing a change for CLI Tool Design Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is CLI scaffolding / argument parser / exit code handler / --json output mode. Follow the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Run echo $? after CLI run + stderr redirection test + --json output validation after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement CLI scaffolding / argument parser / exit code handler / --json output mode" — write patches in the correct dependency order, verified with echo $? after CLI run.
- "Add CLI Tool Design Patterns support" — build incrementally, each step independently testable.
__USB_SKILL_14DF257CBF218A85__

write_file "$PACK_DIR/skills/cloud-cost-optimization-build.md" <<'__USB_SKILL_F35B69D112F1CCFA__'
---
description: "[Cloud Cost Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report."
slug: cloud-cost-optimization-build
name: Cloud Cost Optimisation: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cloud-cost-optimization, workflow:build, implementation, cloud, cost, optimization
---

# Cloud Cost Optimisation: Build

[Cloud Cost Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..

## When to use it
Write or modify code for "Cloud Cost Optimisation". The typical output is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Keep the best practice in mind: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Verify with: cloud cost explorer + instance utilisation report + auto-stop Lambda function test.

## Protocol
You are implementing a change for Cloud Cost Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Follow the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Run cloud cost explorer + instance utilisation report + auto-stop Lambda function test after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report" — write patches in the correct dependency order, verified with cloud cost explorer.
- "Add Cloud Cost Optimisation support" — build incrementally, each step independently testable.
__USB_SKILL_F35B69D112F1CCFA__

write_file "$PACK_DIR/skills/code-review-checklist-build.md" <<'__USB_SKILL_45B57C683326F2D2__'
---
description: "[Code Review Checklist] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets review checklist / automated review comment / risk classification / diff summary."
slug: code-review-checklist-build
name: Code Review Checklist: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:code-review-checklist, workflow:build, implementation, code-review, quality, checklist
---

# Code Review Checklist: Build

[Code Review Checklist] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..

## When to use it
Write or modify code for "Code Review Checklist". The typical output is review checklist / automated review comment / risk classification / diff summary. Keep the best practice in mind: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Verify with: git diff --stat + lint-staged + danger.js automated review + commitlint.

## Protocol
You are implementing a change for Code Review Checklist. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is review checklist / automated review comment / risk classification / diff summary. Follow the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Run git diff --stat + lint-staged + danger.js automated review + commitlint after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific review checklist / automated review comment / risk classification / diff summary this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement review checklist / automated review comment / risk classification / diff summary" — write patches in the correct dependency order, verified with git diff --stat.
- "Add Code Review Checklist support" — build incrementally, each step independently testable.
__USB_SKILL_45B57C683326F2D2__

write_file "$PACK_DIR/skills/convex-functions-build.md" <<'__USB_SKILL_4230391D77B6BD78__'
---
description: "[Convex Functions & Mutations] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets mutation / query / action / component / scheduler job."
slug: convex-functions-build
name: Convex Functions & Mutations: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:convex-functions, workflow:build, implementation, convex, realtime, backend
---

# Convex Functions & Mutations: Build

[Convex Functions & Mutations] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..

## When to use it
Write or modify code for "Convex Functions & Mutations". The typical output is mutation / query / action / component / scheduler job. Keep the best practice in mind: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Verify with: npx convex dev + dashboard OCC conflict log + custom retry logic.

## Protocol
You are implementing a change for Convex Functions & Mutations. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is mutation / query / action / component / scheduler job. Follow the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Run npx convex dev + dashboard OCC conflict log + custom retry logic after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific mutation / query / action / component / scheduler job this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement mutation / query / action / component / scheduler job" — write patches in the correct dependency order, verified with npx convex dev.
- "Add Convex Functions & Mutations support" — build incrementally, each step independently testable.
__USB_SKILL_4230391D77B6BD78__

write_file "$PACK_DIR/skills/cron-job-reliability-build.md" <<'__USB_SKILL_C7BD35B6326F2186__'
---
description: "[Cron Job & Scheduled Task Reliability] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets crontab entry / log rotation / idempotency guard / failure alert integration."
slug: cron-job-reliability-build
name: Cron Job & Scheduled Task Reliability: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cron-job-reliability, workflow:build, implementation, cron, scheduling, reliability
---

# Cron Job & Scheduled Task Reliability: Build

[Cron Job & Scheduled Task Reliability] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..

## When to use it
Write or modify code for "Cron Job & Scheduled Task Reliability". The typical output is crontab entry / log rotation / idempotency guard / failure alert integration. Keep the best practice in mind: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Verify with: tail -f /var/log/cron + systemctl status cron + idempotency test script.

## Protocol
You are implementing a change for Cron Job & Scheduled Task Reliability. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is crontab entry / log rotation / idempotency guard / failure alert integration. Follow the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Run tail -f /var/log/cron + systemctl status cron + idempotency test script after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement crontab entry / log rotation / idempotency guard / failure alert integration" — write patches in the correct dependency order, verified with tail -f /var/log/cron.
- "Add Cron Job & Scheduled Task Reliability support" — build incrementally, each step independently testable.
__USB_SKILL_C7BD35B6326F2186__

write_file "$PACK_DIR/skills/css-layout-build.md" <<'__USB_SKILL_CBD068925158029D__'
---
description: "[CSS Layout & Responsiveness] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CSS layout refactor / responsive grid / container query implementation."
slug: css-layout-build
name: CSS Layout & Responsiveness: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:css-layout, workflow:build, implementation, css, layout, frontend
---

# CSS Layout & Responsiveness: Build

[CSS Layout & Responsiveness] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..

## When to use it
Write or modify code for "CSS Layout & Responsiveness". The typical output is CSS layout refactor / responsive grid / container query implementation. Keep the best practice in mind: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Verify with: Lighthouse mobile emulation + browser DevTools responsive mode.

## Protocol
You are implementing a change for CSS Layout & Responsiveness. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is CSS layout refactor / responsive grid / container query implementation. Follow the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Run Lighthouse mobile emulation + browser DevTools responsive mode after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSS layout refactor / responsive grid / container query implementation this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement CSS layout refactor / responsive grid / container query implementation" — write patches in the correct dependency order, verified with Lighthouse mobile emulation.
- "Add CSS Layout & Responsiveness support" — build incrementally, each step independently testable.
__USB_SKILL_CBD068925158029D__

write_file "$PACK_DIR/skills/csv-data-cleaning-build.md" <<'__USB_SKILL_C1491BF547A03AD3__'
---
description: "[CSV Data Cleaning Pipeline] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CSV parser / row validator / column type mapper / error report / cleaned output."
slug: csv-data-cleaning-build
name: CSV Data Cleaning Pipeline: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:csv-data-cleaning, workflow:build, implementation, data, csv, pipeline
---

# CSV Data Cleaning Pipeline: Build

[CSV Data Cleaning Pipeline] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..

## When to use it
Write or modify code for "CSV Data Cleaning Pipeline". The typical output is CSV parser / row validator / column type mapper / error report / cleaned output. Keep the best practice in mind: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Verify with: python3 -c csv.DictReader + validation script + row count diff.

## Protocol
You are implementing a change for CSV Data Cleaning Pipeline. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is CSV parser / row validator / column type mapper / error report / cleaned output. Follow the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Run python3 -c csv.DictReader + validation script + row count diff after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement CSV parser / row validator / column type mapper / error report / cleaned output" — write patches in the correct dependency order, verified with python3 -c csv.DictReader.
- "Add CSV Data Cleaning Pipeline support" — build incrementally, each step independently testable.
__USB_SKILL_C1491BF547A03AD3__

write_file "$PACK_DIR/skills/database-migration-safety-build.md" <<'__USB_SKILL_1CBDB69C829EECFC__'
---
description: "[Database Migration Safety] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan."
slug: database-migration-safety-build
name: Database Migration Safety: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:database-migration-safety, workflow:build, implementation, database, migration, safety
---

# Database Migration Safety: Build

[Database Migration Safety] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..

## When to use it
Write or modify code for "Database Migration Safety". The typical output is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Keep the best practice in mind: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Verify with: pg_locks monitoring during migration + batch backfill script + rollback test.

## Protocol
You are implementing a change for Database Migration Safety. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Follow the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Run pg_locks monitoring during migration + batch backfill script + rollback test after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement batch migration / expand-contract pattern / zero-downtime migration / rollback plan" — write patches in the correct dependency order, verified with pg_locks monitoring during migration.
- "Add Database Migration Safety support" — build incrementally, each step independently testable.
__USB_SKILL_1CBDB69C829EECFC__

write_file "$PACK_DIR/skills/data-warehouse-schema-build.md" <<'__USB_SKILL_F0C6D5B2591CB6CF__'
---
description: "[Data Warehouse Schema Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets star schema / fact table / dimension table / ETL pipeline spec."
slug: data-warehouse-schema-build
name: Data Warehouse Schema Design: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:data-warehouse-schema, workflow:build, implementation, data, warehouse, schema
---

# Data Warehouse Schema Design: Build

[Data Warehouse Schema Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..

## When to use it
Write or modify code for "Data Warehouse Schema Design". The typical output is star schema / fact table / dimension table / ETL pipeline spec. Keep the best practice in mind: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Verify with: dbt run + dbt test + query profiling with warehouse-native tools.

## Protocol
You are implementing a change for Data Warehouse Schema Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is star schema / fact table / dimension table / ETL pipeline spec. Follow the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Run dbt run + dbt test + query profiling with warehouse-native tools after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific star schema / fact table / dimension table / ETL pipeline spec this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement star schema / fact table / dimension table / ETL pipeline spec" — write patches in the correct dependency order, verified with dbt run.
- "Add Data Warehouse Schema Design support" — build incrementally, each step independently testable.
__USB_SKILL_F0C6D5B2591CB6CF__

write_file "$PACK_DIR/skills/design-token-system-build.md" <<'__USB_SKILL_FA9A84F68AD527F8__'
---
description: "[Design Token Systems] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets token JSON / CSS custom properties / theme switcher / token documentation."
slug: design-token-system-build
name: Design Token Systems: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:design-token-system, workflow:build, implementation, design, tokens, components
---

# Design Token Systems: Build

[Design Token Systems] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..

## When to use it
Write or modify code for "Design Token Systems". The typical output is token JSON / CSS custom properties / theme switcher / token documentation. Keep the best practice in mind: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Verify with: style-dictionary build + Storybook token viewer + token value comparison.

## Protocol
You are implementing a change for Design Token Systems. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is token JSON / CSS custom properties / theme switcher / token documentation. Follow the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Run style-dictionary build + Storybook token viewer + token value comparison after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement token JSON / CSS custom properties / theme switcher / token documentation" — write patches in the correct dependency order, verified with style-dictionary build.
- "Add Design Token Systems support" — build incrementally, each step independently testable.
__USB_SKILL_FA9A84F68AD527F8__

write_file "$PACK_DIR/skills/docker-compose-networking-build.md" <<'__USB_SKILL_4DC79A887B136926__'
---
description: "[Docker Compose Networking] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets docker-compose.yml / network config / healthcheck / depends_on condition."
slug: docker-compose-networking-build
name: Docker Compose Networking: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:docker-compose-networking, workflow:build, implementation, docker, networking, devops
---

# Docker Compose Networking: Build

[Docker Compose Networking] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..

## When to use it
Write or modify code for "Docker Compose Networking". The typical output is docker-compose.yml / network config / healthcheck / depends_on condition. Keep the best practice in mind: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Verify with: docker compose up --wait + docker network inspect + container logs.

## Protocol
You are implementing a change for Docker Compose Networking. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is docker-compose.yml / network config / healthcheck / depends_on condition. Follow the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Run docker compose up --wait + docker network inspect + container logs after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement docker-compose.yml / network config / healthcheck / depends_on condition" — write patches in the correct dependency order, verified with docker compose up --wait.
- "Add Docker Compose Networking support" — build incrementally, each step independently testable.
__USB_SKILL_4DC79A887B136926__

write_file "$PACK_DIR/skills/docker-multistage-build.md" <<'__USB_SKILL_BA887A6232F5A1F0__'
---
description: "[Docker Multi-Stage Builds] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets multi-stage Dockerfile / .dockerignore / slim base image switch."
slug: docker-multistage-build
name: Docker Multi-Stage Builds: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:docker-multistage, workflow:build, implementation, docker, build, devops
---

# Docker Multi-Stage Builds: Build

[Docker Multi-Stage Builds] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..

## When to use it
Write or modify code for "Docker Multi-Stage Builds". The typical output is multi-stage Dockerfile / .dockerignore / slim base image switch. Keep the best practice in mind: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Verify with: docker build + docker scout + dive layer analysis.

## Protocol
You are implementing a change for Docker Multi-Stage Builds. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is multi-stage Dockerfile / .dockerignore / slim base image switch. Follow the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Run docker build + docker scout + dive layer analysis after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement multi-stage Dockerfile / .dockerignore / slim base image switch" — write patches in the correct dependency order, verified with docker build.
- "Add Docker Multi-Stage Builds support" — build incrementally, each step independently testable.
__USB_SKILL_BA887A6232F5A1F0__

write_file "$PACK_DIR/skills/drizzle-schema-design-build.md" <<'__USB_SKILL_6C11DDABA7D582E0__'
---
description: "[Drizzle Schema Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets schema.ts / relation map / migration SQL / Drizzle query builder."
slug: drizzle-schema-design-build
name: Drizzle Schema Design: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:drizzle-schema-design, workflow:build, implementation, drizzle, schema, database
---

# Drizzle Schema Design: Build

[Drizzle Schema Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..

## When to use it
Write or modify code for "Drizzle Schema Design". The typical output is schema.ts / relation map / migration SQL / Drizzle query builder. Keep the best practice in mind: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Verify with: drizzle-kit push + drizzle-kit studio + generated SQL audit.

## Protocol
You are implementing a change for Drizzle Schema Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is schema.ts / relation map / migration SQL / Drizzle query builder. Follow the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Run drizzle-kit push + drizzle-kit studio + generated SQL audit after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement schema.ts / relation map / migration SQL / Drizzle query builder" — write patches in the correct dependency order, verified with drizzle-kit push.
- "Add Drizzle Schema Design support" — build incrementally, each step independently testable.
__USB_SKILL_6C11DDABA7D582E0__

write_file "$PACK_DIR/skills/error-monitoring-setup-build.md" <<'__USB_SKILL_6CEE545CD5103FD2__'
---
description: "[Error Monitoring & Alerting Setup] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring."
slug: error-monitoring-setup-build
name: Error Monitoring & Alerting Setup: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:error-monitoring-setup, workflow:build, implementation, monitoring, errors, alerts
---

# Error Monitoring & Alerting Setup: Build

[Error Monitoring & Alerting Setup] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..

## When to use it
Write or modify code for "Error Monitoring & Alerting Setup". The typical output is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Keep the best practice in mind: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Verify with: Sentry API error list + alert rule test + source map validation.

## Protocol
You are implementing a change for Error Monitoring & Alerting Setup. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Follow the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Run Sentry API error list + alert rule test + source map validation after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement Sentry project config / alert rule / error grouping / source map upload / performance monitoring" — write patches in the correct dependency order, verified with Sentry API error list.
- "Add Error Monitoring & Alerting Setup support" — build incrementally, each step independently testable.
__USB_SKILL_6CEE545CD5103FD2__

write_file "$PACK_DIR/skills/fastapi-dependencies-build.md" <<'__USB_SKILL_76A1C316B4BAC553__'
---
description: "[FastAPI Dependency Injection] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets dependency / lifespan handler / override for testing."
slug: fastapi-dependencies-build
name: FastAPI Dependency Injection: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:fastapi-dependencies, workflow:build, implementation, fastapi, dependencies, api
---

# FastAPI Dependency Injection: Build

[FastAPI Dependency Injection] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..

## When to use it
Write or modify code for "FastAPI Dependency Injection". The typical output is dependency / lifespan handler / override for testing. Keep the best practice in mind: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Verify with: uvicorn --reload + /docs interactive test + dependency graph visualisation.

## Protocol
You are implementing a change for FastAPI Dependency Injection. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is dependency / lifespan handler / override for testing. Follow the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Run uvicorn --reload + /docs interactive test + dependency graph visualisation after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific dependency / lifespan handler / override for testing this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement dependency / lifespan handler / override for testing" — write patches in the correct dependency order, verified with uvicorn --reload.
- "Add FastAPI Dependency Injection support" — build incrementally, each step independently testable.
__USB_SKILL_76A1C316B4BAC553__

write_file "$PACK_DIR/skills/feature-flags-build.md" <<'__USB_SKILL_08068A70CC06DF70__'
---
description: "[Feature Flags & Gradual Rollouts] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag."
slug: feature-flags-build
name: Feature Flags & Gradual Rollouts: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:feature-flags, workflow:build, implementation, feature-flags, rollout, devops
---

# Feature Flags & Gradual Rollouts: Build

[Feature Flags & Gradual Rollouts] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..

## When to use it
Write or modify code for "Feature Flags & Gradual Rollouts". The typical output is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Keep the best practice in mind: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Verify with: flag evaluation log + rollout percentage monitoring + unused flag scan.

## Protocol
You are implementing a change for Feature Flags & Gradual Rollouts. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Follow the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Run flag evaluation log + rollout percentage monitoring + unused flag scan after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement flag provider config / gradual rollout target / flag cleanup plan / A/B test flag" — write patches in the correct dependency order, verified with flag evaluation log.
- "Add Feature Flags & Gradual Rollouts support" — build incrementally, each step independently testable.
__USB_SKILL_08068A70CC06DF70__

write_file "$PACK_DIR/skills/git-conflict-resolution-build.md" <<'__USB_SKILL_2728484E400B46A9__'
---
description: "[Git Conflict Resolution] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message."
slug: git-conflict-resolution-build
name: Git Conflict Resolution: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:git-conflict-resolution, workflow:build, implementation, git, conflicts, workflow
---

# Git Conflict Resolution: Build

[Git Conflict Resolution] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..

## When to use it
Write or modify code for "Git Conflict Resolution". The typical output is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Keep the best practice in mind: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Verify with: git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere.

## Protocol
You are implementing a change for Git Conflict Resolution. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Follow the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Run git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message" — write patches in the correct dependency order, verified with git log --oneline -5 -- <file>.
- "Add Git Conflict Resolution support" — build incrementally, each step independently testable.
__USB_SKILL_2728484E400B46A9__

write_file "$PACK_DIR/skills/github-actions-pipeline-build.md" <<'__USB_SKILL_30EFFD8E6C31A281__'
---
description: "[GitHub Actions Pipeline Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets workflow YAML / cache config / matrix build / conditional job execution."
slug: github-actions-pipeline-build
name: GitHub Actions Pipeline Optimisation: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:github-actions-pipeline, workflow:build, implementation, github-actions, ci, devops
---

# GitHub Actions Pipeline Optimisation: Build

[GitHub Actions Pipeline Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..

## When to use it
Write or modify code for "GitHub Actions Pipeline Optimisation". The typical output is workflow YAML / cache config / matrix build / conditional job execution. Keep the best practice in mind: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Verify with: act --job test + cache hit/miss analysis + workflow graph visualisation.

## Protocol
You are implementing a change for GitHub Actions Pipeline Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is workflow YAML / cache config / matrix build / conditional job execution. Follow the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Run act --job test + cache hit/miss analysis + workflow graph visualisation after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific workflow YAML / cache config / matrix build / conditional job execution this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement workflow YAML / cache config / matrix build / conditional job execution" — write patches in the correct dependency order, verified with act --job test.
- "Add GitHub Actions Pipeline Optimisation support" — build incrementally, each step independently testable.
__USB_SKILL_30EFFD8E6C31A281__

write_file "$PACK_DIR/skills/graphql-n-plus-one-build.md" <<'__USB_SKILL_3E824AFCB1D0DCAC__'
---
description: "[GraphQL N+1 Query Prevention] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis."
slug: graphql-n-plus-one-build
name: GraphQL N+1 Query Prevention: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:graphql-n-plus-one, workflow:build, implementation, graphql, n-plus-one, performance
---

# GraphQL N+1 Query Prevention: Build

[GraphQL N+1 Query Prevention] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..

## When to use it
Write or modify code for "GraphQL N+1 Query Prevention". The typical output is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Keep the best practice in mind: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Verify with: graphql query with tracing + DataLoader statistics + SQL log analysis.

## Protocol
You are implementing a change for GraphQL N+1 Query Prevention. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Follow the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Run graphql query with tracing + DataLoader statistics + SQL log analysis after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement DataLoader instance / batch load function / resolver refactor / query complexity analysis" — write patches in the correct dependency order, verified with graphql query with tracing.
- "Add GraphQL N+1 Query Prevention support" — build incrementally, each step independently testable.
__USB_SKILL_3E824AFCB1D0DCAC__

write_file "$PACK_DIR/skills/jest-test-optimization-build.md" <<'__USB_SKILL_7351266C9279F850__'
---
description: "[Jest Test Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking."
slug: jest-test-optimization-build
name: Jest Test Optimisation: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:jest-test-optimization, workflow:build, implementation, jest, testing, optimisation
---

# Jest Test Optimisation: Build

[Jest Test Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..

## When to use it
Write or modify code for "Jest Test Optimisation". The typical output is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Keep the best practice in mind: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Verify with: jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check.

## Protocol
You are implementing a change for Jest Test Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Follow the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Run jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking" — write patches in the correct dependency order, verified with jest --changedSince=main --json.
- "Add Jest Test Optimisation support" — build incrementally, each step independently testable.
__USB_SKILL_7351266C9279F850__

write_file "$PACK_DIR/skills/json-schema-validation-build.md" <<'__USB_SKILL_508F790B8FB90544__'
---
description: "[JSON Schema Validation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets JSON Schema / validator middleware / type guard / error message / response parser."
slug: json-schema-validation-build
name: JSON Schema Validation: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:json-schema-validation, workflow:build, implementation, json, validation, api
---

# JSON Schema Validation: Build

[JSON Schema Validation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..

## When to use it
Write or modify code for "JSON Schema Validation". The typical output is JSON Schema / validator middleware / type guard / error message / response parser. Keep the best practice in mind: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Verify with: ajv validate + JSON Schema test suite + response mock test.

## Protocol
You are implementing a change for JSON Schema Validation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is JSON Schema / validator middleware / type guard / error message / response parser. Follow the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Run ajv validate + JSON Schema test suite + response mock test after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement JSON Schema / validator middleware / type guard / error message / response parser" — write patches in the correct dependency order, verified with ajv validate.
- "Add JSON Schema Validation support" — build incrementally, each step independently testable.
__USB_SKILL_508F790B8FB90544__

write_file "$PACK_DIR/skills/kubernetes-hpa-build.md" <<'__USB_SKILL_80ABB7F0BD577371__'
---
description: "[Kubernetes Horizontal Pod Autoscaling] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config."
slug: kubernetes-hpa-build
name: Kubernetes Horizontal Pod Autoscaling: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-hpa, workflow:build, implementation, kubernetes, autoscaling, devops
---

# Kubernetes Horizontal Pod Autoscaling: Build

[Kubernetes Horizontal Pod Autoscaling] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..

## When to use it
Write or modify code for "Kubernetes Horizontal Pod Autoscaling". The typical output is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Keep the best practice in mind: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Verify with: kubectl get hpa --watch + kubectl top pods + metrics-server logs.

## Protocol
You are implementing a change for Kubernetes Horizontal Pod Autoscaling. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Follow the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Run kubectl get hpa --watch + kubectl top pods + metrics-server logs after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config" — write patches in the correct dependency order, verified with kubectl get hpa --watch.
- "Add Kubernetes Horizontal Pod Autoscaling support" — build incrementally, each step independently testable.
__USB_SKILL_80ABB7F0BD577371__

write_file "$PACK_DIR/skills/kubernetes-pod-lifecycle-build.md" <<'__USB_SKILL_A2F6E5E1305188D8__'
---
description: "[Kubernetes Pod Lifecycle] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container."
slug: kubernetes-pod-lifecycle-build
name: Kubernetes Pod Lifecycle: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-pod-lifecycle, workflow:build, implementation, kubernetes, pods, devops
---

# Kubernetes Pod Lifecycle: Build

[Kubernetes Pod Lifecycle] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..

## When to use it
Write or modify code for "Kubernetes Pod Lifecycle". The typical output is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Keep the best practice in mind: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Verify with: kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'.

## Protocol
You are implementing a change for Kubernetes Pod Lifecycle. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Follow the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Run kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp' after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement deployment.yaml / startup probe / readiness probe / liveness probe / init container" — write patches in the correct dependency order, verified with kubectl describe pod.
- "Add Kubernetes Pod Lifecycle support" — build incrementally, each step independently testable.
__USB_SKILL_A2F6E5E1305188D8__

write_file "$PACK_DIR/skills/context-window-budget-build.md" <<'__USB_SKILL_ADC6E8A9963DFD6A__'
---
description: "[LLM Context Window Budget Management] Implement the smallest viable patches in dependency order; each patch must be independently verifiable Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard."
slug: context-window-budget-build
name: LLM Context Window Budget Management: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:context-window-budget, workflow:build, implementation, context, tokens, llm, memory, summarization
---

# LLM Context Window Budget Management: Build

[LLM Context Window Budget Management] Implement the smallest viable patches in dependency order; each patch must be independently verifiable Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..

## When to use it
Write or modify code for "LLM Context Window Budget Management". The typical output is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Keep the best practice in mind: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Verify with: tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry.

## Protocol
You are implementing a change for LLM Context Window Budget Management. Implement the smallest viable patches in dependency order; each patch must be independently verifiable. The target output is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Follow the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Run tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves.

## Output contract
- **md** (markdown): MD output
- **diff** (diff): DIFF output
- **cmd** (command): CMD output

## Examples
- "Implement trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard" — write patches in the correct dependency order, verified with tiktoken count.
- "Add LLM Context Window Budget Management support" — build incrementally, each step independently testable.
__USB_SKILL_ADC6E8A9963DFD6A__

write_file "$PACK_DIR/skills/mcp-tool-design-build.md" <<'__USB_SKILL_D9F003C2C034CB1C__'
---
description: "[MCP Tool Design & Best Practices] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets MCP tool descriptor / resource definition / prompt template / server metadata."
slug: mcp-tool-design-build
name: MCP Tool Design & Best Practices: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:mcp-tool-design, workflow:build, implementation, mcp, tools, agents
---

# MCP Tool Design & Best Practices: Build

[MCP Tool Design & Best Practices] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..

## When to use it
Write or modify code for "MCP Tool Design & Best Practices". The typical output is MCP tool descriptor / resource definition / prompt template / server metadata. Keep the best practice in mind: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Verify with: mcp-cli run + mcp inspector + tool name conflict analysis.

## Protocol
You are implementing a change for MCP Tool Design & Best Practices. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is MCP tool descriptor / resource definition / prompt template / server metadata. Follow the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Run mcp-cli run + mcp inspector + tool name conflict analysis after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement MCP tool descriptor / resource definition / prompt template / server metadata" — write patches in the correct dependency order, verified with mcp-cli run.
- "Add MCP Tool Design & Best Practices support" — build incrementally, each step independently testable.
__USB_SKILL_D9F003C2C034CB1C__

write_file "$PACK_DIR/skills/message-queues-build.md" <<'__USB_SKILL_1F44B93551C0F3A2__'
---
description: "[Message Queues & Background Jobs] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets queue producer / worker / dead-letter handler / retry policy."
slug: message-queues-build
name: Message Queues & Background Jobs: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:message-queues, workflow:build, implementation, queue, background-jobs, backend
---

# Message Queues & Background Jobs: Build

[Message Queues & Background Jobs] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..

## When to use it
Write or modify code for "Message Queues & Background Jobs". The typical output is queue producer / worker / dead-letter handler / retry policy. Keep the best practice in mind: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Verify with: Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection.

## Protocol
You are implementing a change for Message Queues & Background Jobs. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is queue producer / worker / dead-letter handler / retry policy. Follow the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Run Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific queue producer / worker / dead-letter handler / retry policy this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement queue producer / worker / dead-letter handler / retry policy" — write patches in the correct dependency order, verified with Bull/BullMQ dashboard.
- "Add Message Queues & Background Jobs support" — build incrementally, each step independently testable.
__USB_SKILL_1F44B93551C0F3A2__

write_file "$PACK_DIR/skills/multi-tenant-isolation-build.md" <<'__USB_SKILL_41FB3C25F370B805__'
---
description: "[Multi-Tenant Data Isolation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder."
slug: multi-tenant-isolation-build
name: Multi-Tenant Data Isolation: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:multi-tenant-isolation, workflow:build, implementation, multi-tenant, saas, database
---

# Multi-Tenant Data Isolation: Build

[Multi-Tenant Data Isolation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..

## When to use it
Write or modify code for "Multi-Tenant Data Isolation". The typical output is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Keep the best practice in mind: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Verify with: RLS policy test with two different tenant sessions + data leakage check.

## Protocol
You are implementing a change for Multi-Tenant Data Isolation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Follow the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Run RLS policy test with two different tenant sessions + data leakage check after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement RLS policy / tenant context middleware / session variable injection / tenant-aware query builder" — write patches in the correct dependency order, verified with RLS policy test with two different tenant sessions.
- "Add Multi-Tenant Data Isolation support" — build incrementally, each step independently testable.
__USB_SKILL_41FB3C25F370B805__

write_file "$PACK_DIR/skills/nextjs-api-routes-build.md" <<'__USB_SKILL_4D45F5F019043621__'
---
description: "[Next.js API Routes & Route Handlers] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets route.ts handler / server action / API client wrapper / error boundary."
slug: nextjs-api-routes-build
name: Next.js API Routes & Route Handlers: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-api-routes, workflow:build, implementation, nextjs, api, backend
---

# Next.js API Routes & Route Handlers: Build

[Next.js API Routes & Route Handlers] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..

## When to use it
Write or modify code for "Next.js API Routes & Route Handlers". The typical output is route.ts handler / server action / API client wrapper / error boundary. Keep the best practice in mind: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Verify with: curl --verbose + API route error log + status code audit.

## Protocol
You are implementing a change for Next.js API Routes & Route Handlers. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is route.ts handler / server action / API client wrapper / error boundary. Follow the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Run curl --verbose + API route error log + status code audit after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific route.ts handler / server action / API client wrapper / error boundary this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement route.ts handler / server action / API client wrapper / error boundary" — write patches in the correct dependency order, verified with curl --verbose.
- "Add Next.js API Routes & Route Handlers support" — build incrementally, each step independently testable.
__USB_SKILL_4D45F5F019043621__

write_file "$PACK_DIR/skills/nextjs-data-fetching-build.md" <<'__USB_SKILL_AD03DC07B99F6911__'
---
description: "[Next.js Data Fetching Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets server fetch / React cache wrapper / streaming suspense boundary."
slug: nextjs-data-fetching-build
name: Next.js Data Fetching Patterns: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-data-fetching, workflow:build, implementation, nextjs, data-fetching, fullstack
---

# Next.js Data Fetching Patterns: Build

[Next.js Data Fetching Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..

## When to use it
Write or modify code for "Next.js Data Fetching Patterns". The typical output is server fetch / React cache wrapper / streaming suspense boundary. Keep the best practice in mind: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Verify with: next build --debug + React DevTools fetch profiling.

## Protocol
You are implementing a change for Next.js Data Fetching Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is server fetch / React cache wrapper / streaming suspense boundary. Follow the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Run next build --debug + React DevTools fetch profiling after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server fetch / React cache wrapper / streaming suspense boundary this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement server fetch / React cache wrapper / streaming suspense boundary" — write patches in the correct dependency order, verified with next build --debug.
- "Add Next.js Data Fetching Patterns support" — build incrementally, each step independently testable.
__USB_SKILL_AD03DC07B99F6911__

write_file "$PACK_DIR/skills/nextjs-middleware-build.md" <<'__USB_SKILL_69D806AB650D3FF3__'
---
description: "[Next.js Middleware & Edge Runtime] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing."
slug: nextjs-middleware-build
name: Next.js Middleware & Edge Runtime: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-middleware, workflow:build, implementation, nextjs, middleware, edge
---

# Next.js Middleware & Edge Runtime: Build

[Next.js Middleware & Edge Runtime] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..

## When to use it
Write or modify code for "Next.js Middleware & Edge Runtime". The typical output is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Keep the best practice in mind: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Verify with: next dev + curl --cookie tests + edge runtime log inspection.

## Protocol
You are implementing a change for Next.js Middleware & Edge Runtime. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Follow the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Run next dev + curl --cookie tests + edge runtime log inspection after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement middleware.ts / rewrite rule / cookie-based redirect / geolocation routing" — write patches in the correct dependency order, verified with next dev.
- "Add Next.js Middleware & Edge Runtime support" — build incrementally, each step independently testable.
__USB_SKILL_69D806AB650D3FF3__

write_file "$PACK_DIR/skills/node-error-handling-build.md" <<'__USB_SKILL_BBC34F9B19341EFA__'
---
description: "[Node.js Error Handling & Resilience] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets global error handler / async wrapper / structured error response / retry logic."
slug: node-error-handling-build
name: Node.js Error Handling & Resilience: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:node-error-handling, workflow:build, implementation, node, error-handling, backend
---

# Node.js Error Handling & Resilience: Build

[Node.js Error Handling & Resilience] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..

## When to use it
Write or modify code for "Node.js Error Handling & Resilience". The typical output is global error handler / async wrapper / structured error response / retry logic. Keep the best practice in mind: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Verify with: node --unhandled-rejections=strict + process.on('uncaughtException') log.

## Protocol
You are implementing a change for Node.js Error Handling & Resilience. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is global error handler / async wrapper / structured error response / retry logic. Follow the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Run node --unhandled-rejections=strict + process.on('uncaughtException') log after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific global error handler / async wrapper / structured error response / retry logic this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement global error handler / async wrapper / structured error response / retry logic" — write patches in the correct dependency order, verified with node --unhandled-rejections=strict.
- "Add Node.js Error Handling & Resilience support" — build incrementally, each step independently testable.
__USB_SKILL_BBC34F9B19341EFA__

write_file "$PACK_DIR/skills/node-streams-build.md" <<'__USB_SKILL_70AB54337E2DC1E2__'
---
description: "[Node.js Streams & Backpressure] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Readable/Writable stream / Transform / pipeline() refactor."
slug: node-streams-build
name: Node.js Streams & Backpressure: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:node-streams, workflow:build, implementation, node, streams, performance
---

# Node.js Streams & Backpressure: Build

[Node.js Streams & Backpressure] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..

## When to use it
Write or modify code for "Node.js Streams & Backpressure". The typical output is Readable/Writable stream / Transform / pipeline() refactor. Keep the best practice in mind: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Verify with: Node.js --inspect memory heap snapshot + stream highWaterMark tuning.

## Protocol
You are implementing a change for Node.js Streams & Backpressure. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is Readable/Writable stream / Transform / pipeline() refactor. Follow the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Run Node.js --inspect memory heap snapshot + stream highWaterMark tuning after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Readable/Writable stream / Transform / pipeline() refactor this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement Readable/Writable stream / Transform / pipeline() refactor" — write patches in the correct dependency order, verified with Node.js --inspect memory heap snapshot.
- "Add Node.js Streams & Backpressure support" — build incrementally, each step independently testable.
__USB_SKILL_70AB54337E2DC1E2__

write_file "$PACK_DIR/skills/oauth-flows-build.md" <<'__USB_SKILL_926C96F1896B33A3__'
---
description: "[OAuth 2.0 Flows & Token Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler."
slug: oauth-flows-build
name: OAuth 2.0 Flows & Token Management: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:oauth-flows, workflow:build, implementation, oauth, auth, security
---

# OAuth 2.0 Flows & Token Management: Build

[OAuth 2.0 Flows & Token Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..

## When to use it
Write or modify code for "OAuth 2.0 Flows & Token Management". The typical output is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Keep the best practice in mind: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Verify with: oauth2_proxy + jwt.io debugger + curl --cookie with token inspection.

## Protocol
You are implementing a change for OAuth 2.0 Flows & Token Management. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Follow the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Run oauth2_proxy + jwt.io debugger + curl --cookie with token inspection after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement OAuth callback / token refresh / PKCE flow / httpOnly cookie handler" — write patches in the correct dependency order, verified with oauth2_proxy.
- "Add OAuth 2.0 Flows & Token Management support" — build incrementally, each step independently testable.
__USB_SKILL_926C96F1896B33A3__

write_file "$PACK_DIR/skills/openapi-spec-build.md" <<'__USB_SKILL_AFA7004A2AEB6FD2__'
---
description: "[OpenAPI Specification & Validation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets openapi.yaml / code-first generator / request/response validation middleware."
slug: openapi-spec-build
name: OpenAPI Specification & Validation: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:openapi-spec, workflow:build, implementation, openapi, api, contract
---

# OpenAPI Specification & Validation: Build

[OpenAPI Specification & Validation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..

## When to use it
Write or modify code for "OpenAPI Specification & Validation". The typical output is openapi.yaml / code-first generator / request/response validation middleware. Keep the best practice in mind: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Verify with: redocly lint + openapi-diff + swagger-ui preview.

## Protocol
You are implementing a change for OpenAPI Specification & Validation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is openapi.yaml / code-first generator / request/response validation middleware. Follow the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Run redocly lint + openapi-diff + swagger-ui preview after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific openapi.yaml / code-first generator / request/response validation middleware this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement openapi.yaml / code-first generator / request/response validation middleware" — write patches in the correct dependency order, verified with redocly lint.
- "Add OpenAPI Specification & Validation support" — build incrementally, each step independently testable.
__USB_SKILL_AFA7004A2AEB6FD2__

write_file "$PACK_DIR/skills/playwright-selectors-build.md" <<'__USB_SKILL_CF026BEA3867D45C__'
---
description: "[Playwright Selectors & Locators] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture."
slug: playwright-selectors-build
name: Playwright Selectors & Locators: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:playwright-selectors, workflow:build, implementation, playwright, testing, e2e
---

# Playwright Selectors & Locators: Build

[Playwright Selectors & Locators] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..

## When to use it
Write or modify code for "Playwright Selectors & Locators". The typical output is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Keep the best practice in mind: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Verify with: playwright test --reporter=html + playwright codegen + trace viewer.

## Protocol
You are implementing a change for Playwright Selectors & Locators. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Follow the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Run playwright test --reporter=html + playwright codegen + trace viewer after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement locator refactor / test fixture / POM (Page Object Model) / custom fixture" — write patches in the correct dependency order, verified with playwright test --reporter=html.
- "Add Playwright Selectors & Locators support" — build incrementally, each step independently testable.
__USB_SKILL_CF026BEA3867D45C__

write_file "$PACK_DIR/skills/prompt-injection-defense-build.md" <<'__USB_SKILL_616B140E4568B43D__'
---
description: "[Prompt Injection Defense] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator."
slug: prompt-injection-defense-build
name: Prompt Injection Defense: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:prompt-injection-defense, workflow:build, implementation, prompt, security, llm
---

# Prompt Injection Defense: Build

[Prompt Injection Defense] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..

## When to use it
Write or modify code for "Prompt Injection Defense". The typical output is defensive system prompt / input sanitizer / instruction guardrail / output validator. Keep the best practice in mind: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Verify with: prompt injection test suite + adversarial input fuzzing + output scanner.

## Protocol
You are implementing a change for Prompt Injection Defense. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is defensive system prompt / input sanitizer / instruction guardrail / output validator. Follow the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Run prompt injection test suite + adversarial input fuzzing + output scanner after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement defensive system prompt / input sanitizer / instruction guardrail / output validator" — write patches in the correct dependency order, verified with prompt injection test suite.
- "Add Prompt Injection Defense support" — build incrementally, each step independently testable.
__USB_SKILL_616B140E4568B43D__

write_file "$PACK_DIR/skills/python-async-build.md" <<'__USB_SKILL_826B145197501691__'
---
description: "[Python Async/Await Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets async/await refactor / asyncio.gather / async context manager."
slug: python-async-build
name: Python Async/Await Patterns: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:python-async, workflow:build, implementation, python, async, performance
---

# Python Async/Await Patterns: Build

[Python Async/Await Patterns] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..

## When to use it
Write or modify code for "Python Async/Await Patterns". The typical output is async/await refactor / asyncio.gather / async context manager. Keep the best practice in mind: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Verify with: python3 -m asyncio + aiohttp/httpx async benchmark.

## Protocol
You are implementing a change for Python Async/Await Patterns. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is async/await refactor / asyncio.gather / async context manager. Follow the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Run python3 -m asyncio + aiohttp/httpx async benchmark after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific async/await refactor / asyncio.gather / async context manager this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement async/await refactor / asyncio.gather / async context manager" — write patches in the correct dependency order, verified with python3 -m asyncio.
- "Add Python Async/Await Patterns support" — build incrementally, each step independently testable.
__USB_SKILL_826B145197501691__

write_file "$PACK_DIR/skills/python-file-io-build.md" <<'__USB_SKILL_E641BDE9837B748B__'
---
description: "[Python File I/O & Encoding] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets pathlib refactor / encoding-safe file reader / batch file processor."
slug: python-file-io-build
name: Python File I/O & Encoding: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:python-file-io, workflow:build, implementation, python, file-io, scripting
---

# Python File I/O & Encoding: Build

[Python File I/O & Encoding] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..

## When to use it
Write or modify code for "Python File I/O & Encoding". The typical output is pathlib refactor / encoding-safe file reader / batch file processor. Keep the best practice in mind: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Verify with: python3 -c with open() + chardet encoding detection.

## Protocol
You are implementing a change for Python File I/O & Encoding. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is pathlib refactor / encoding-safe file reader / batch file processor. Follow the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Run python3 -c with open() + chardet encoding detection after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement pathlib refactor / encoding-safe file reader / batch file processor" — write patches in the correct dependency order, verified with python3 -c with open().
- "Add Python File I/O & Encoding support" — build incrementally, each step independently testable.
__USB_SKILL_E641BDE9837B748B__

write_file "$PACK_DIR/skills/rag-chunking-build.md" <<'__USB_SKILL_9D817AB0405895AA__'
---
description: "[RAG Chunking Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment."
slug: rag-chunking-build
name: RAG Chunking Strategies: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rag-chunking, workflow:build, implementation, rag, chunking, retrieval
---

# RAG Chunking Strategies: Build

[RAG Chunking Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..

## When to use it
Write or modify code for "RAG Chunking Strategies". The typical output is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Keep the best practice in mind: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Verify with: retrieval evaluation script + chunk boundary visualisation + recall@k measurement.

## Protocol
You are implementing a change for RAG Chunking Strategies. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Follow the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Run retrieval evaluation script + chunk boundary visualisation + recall@k measurement after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment" — write patches in the correct dependency order, verified with retrieval evaluation script.
- "Add RAG Chunking Strategies support" — build incrementally, each step independently testable.
__USB_SKILL_9D817AB0405895AA__

write_file "$PACK_DIR/skills/rate-limiting-proxy-build.md" <<'__USB_SKILL_0D7E0E1767D463DB__'
---
description: "[Rate Limiting & API Gateway Proxy] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation."
slug: rate-limiting-proxy-build
name: Rate Limiting & API Gateway Proxy: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rate-limiting-proxy, workflow:build, implementation, rate-limiting, proxy, security
---

# Rate Limiting & API Gateway Proxy: Build

[Rate Limiting & API Gateway Proxy] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..

## When to use it
Write or modify code for "Rate Limiting & API Gateway Proxy". The typical output is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Keep the best practice in mind: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Verify with: ab -n 1000 -c 10 + nginx error log + 429 response code monitoring.

## Protocol
You are implementing a change for Rate Limiting & API Gateway Proxy. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Follow the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Run ab -n 1000 -c 10 + nginx error log + 429 response code monitoring after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation" — write patches in the correct dependency order, verified with ab -n 1000 -c 10.
- "Add Rate Limiting & API Gateway Proxy support" — build incrementally, each step independently testable.
__USB_SKILL_0D7E0E1767D463DB__

write_file "$PACK_DIR/skills/react-server-components-build.md" <<'__USB_SKILL_1387C116B5CD46F7__'
---
description: "[React Server Components] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets server component / client boundary refactor / streaming fallback."
slug: react-server-components-build
name: React Server Components: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:react-server-components, workflow:build, implementation, react, rsc, frontend
---

# React Server Components: Build

[React Server Components] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..

## When to use it
Write or modify code for "React Server Components". The typical output is server component / client boundary refactor / streaming fallback. Keep the best practice in mind: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Verify with: next build --debug + React Server Components lint rule.

## Protocol
You are implementing a change for React Server Components. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is server component / client boundary refactor / streaming fallback. Follow the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Run next build --debug + React Server Components lint rule after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server component / client boundary refactor / streaming fallback this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement server component / client boundary refactor / streaming fallback" — write patches in the correct dependency order, verified with next build --debug.
- "Add React Server Components support" — build incrementally, each step independently testable.
__USB_SKILL_1387C116B5CD46F7__

write_file "$PACK_DIR/skills/react-state-build.md" <<'__USB_SKILL_FE6008FDF642AA38__'
---
description: "[React State Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice."
slug: react-state-build
name: React State Management: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:react-state, workflow:build, implementation, react, state, frontend
---

# React State Management: Build

[React State Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..

## When to use it
Write or modify code for "React State Management". The typical output is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Keep the best practice in mind: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Verify with: React DevTools profiler + why-did-you-render.

## Protocol
You are implementing a change for React State Management. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Follow the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Run React DevTools profiler + why-did-you-render after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement useState / useReducer / useContext hook refactor, zustand or jotai store slice" — write patches in the correct dependency order, verified with React DevTools profiler.
- "Add React State Management support" — build incrementally, each step independently testable.
__USB_SKILL_FE6008FDF642AA38__

write_file "$PACK_DIR/skills/redis-caching-build.md" <<'__USB_SKILL_43B4EF29CB0C2ACE__'
---
description: "[Redis Caching Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy."
slug: redis-caching-build
name: Redis Caching Strategies: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:redis-caching, workflow:build, implementation, redis, caching, performance
---

# Redis Caching Strategies: Build

[Redis Caching Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..

## When to use it
Write or modify code for "Redis Caching Strategies". The typical output is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Keep the best practice in mind: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Verify with: redis-cli --stat + cache hit ratio monitoring + slow log.

## Protocol
You are implementing a change for Redis Caching Strategies. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Follow the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Run redis-cli --stat + cache hit ratio monitoring + slow log after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement cache wrapper / mutex lock / stale-while-revalidate / TTL policy" — write patches in the correct dependency order, verified with redis-cli --stat.
- "Add Redis Caching Strategies support" — build incrementally, each step independently testable.
__USB_SKILL_43B4EF29CB0C2ACE__

write_file "$PACK_DIR/skills/rest-pagination-build.md" <<'__USB_SKILL_C9CC4E52FDDE375B__'
---
description: "[REST Pagination Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope."
slug: rest-pagination-build
name: REST Pagination Design: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rest-pagination, workflow:build, implementation, rest, pagination, api
---

# REST Pagination Design: Build

[REST Pagination Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..

## When to use it
Write or modify code for "REST Pagination Design". The typical output is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Keep the best practice in mind: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Verify with: curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark.

## Protocol
You are implementing a change for REST Pagination Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Follow the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Run curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement cursor pagination / offset pagination fallback / total count optimisation / response envelope" — write patches in the correct dependency order, verified with curl with cursor param.
- "Add REST Pagination Design support" — build incrementally, each step independently testable.
__USB_SKILL_C9CC4E52FDDE375B__

write_file "$PACK_DIR/skills/secrets-rotation-build.md" <<'__USB_SKILL_39CCC266DE8611A1__'
---
description: "[Secrets Rotation Policy] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets rotation script / vault integration / lease management / incident response plan."
slug: secrets-rotation-build
name: Secrets Rotation Policy: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:secrets-rotation, workflow:build, implementation, secrets, security, rotation
---

# Secrets Rotation Policy: Build

[Secrets Rotation Policy] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..

## When to use it
Write or modify code for "Secrets Rotation Policy". The typical output is rotation script / vault integration / lease management / incident response plan. Keep the best practice in mind: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Verify with: vault lease list + secret expiry check + rotation dry-run test.

## Protocol
You are implementing a change for Secrets Rotation Policy. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is rotation script / vault integration / lease management / incident response plan. Follow the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Run vault lease list + secret expiry check + rotation dry-run test after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific rotation script / vault integration / lease management / incident response plan this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement rotation script / vault integration / lease management / incident response plan" — write patches in the correct dependency order, verified with vault lease list.
- "Add Secrets Rotation Policy support" — build incrementally, each step independently testable.
__USB_SKILL_39CCC266DE8611A1__

write_file "$PACK_DIR/skills/shell-script-robustness-build.md" <<'__USB_SKILL_328D8C033C61E1F7__'
---
description: "[Shell Script Robustness & Safety] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function."
slug: shell-script-robustness-build
name: Shell Script Robustness & Safety: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:shell-script-robustness, workflow:build, implementation, shell, scripting, safety
---

# Shell Script Robustness & Safety: Build

[Shell Script Robustness & Safety] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..

## When to use it
Write or modify code for "Shell Script Robustness & Safety". The typical output is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Keep the best practice in mind: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Verify with: shellcheck script.sh + bash -n script.sh + dry-run mode test.

## Protocol
You are implementing a change for Shell Script Robustness & Safety. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Follow the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Run shellcheck script.sh + bash -n script.sh + dry-run mode test after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function" — write patches in the correct dependency order, verified with shellcheck script.sh.
- "Add Shell Script Robustness & Safety support" — build incrementally, each step independently testable.
__USB_SKILL_328D8C033C61E1F7__

write_file "$PACK_DIR/skills/sql-query-optimization-build.md" <<'__USB_SKILL_8023F281878ED7E6__'
---
description: "[SQL Query Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index."
slug: sql-query-optimization-build
name: SQL Query Optimisation: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:sql-query-optimization, workflow:build, implementation, sql, optimization, database
---

# SQL Query Optimisation: Build

[SQL Query Optimisation] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..

## When to use it
Write or modify code for "SQL Query Optimisation". The typical output is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Keep the best practice in mind: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Verify with: EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query.

## Protocol
You are implementing a change for SQL Query Optimisation. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Follow the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Run EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement indexed query / composite index / EXPLAIN ANALYSE plan / partial index" — write patches in the correct dependency order, verified with EXPLAIN (ANALYSE, BUFFERS).
- "Add SQL Query Optimisation support" — build incrementally, each step independently testable.
__USB_SKILL_8023F281878ED7E6__

write_file "$PACK_DIR/skills/stealth-web-research-build.md" <<'__USB_SKILL_EDE90056F4C778B6__'
---
description: "[Stealth Web Research & Harvesting] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages."
slug: stealth-web-research-build
name: Stealth Web Research & Harvesting: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:stealth-web-research, workflow:build, implementation, stealth, scraping, research, anti-bot
---

# Stealth Web Research & Harvesting: Build

[Stealth Web Research & Harvesting] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..

## When to use it
Write or modify code for "Stealth Web Research & Harvesting". The typical output is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Keep the best practice in mind: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Verify with: playwright-extra + stealth + cheerio + defuddle + manual jq inspection.

## Protocol
You are implementing a change for Stealth Web Research & Harvesting. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Follow the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Run playwright-extra + stealth + cheerio + defuddle + manual jq inspection after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages" — write patches in the correct dependency order, verified with playwright-extra.
- "Add Stealth Web Research & Harvesting support" — build incrementally, each step independently testable.
__USB_SKILL_EDE90056F4C778B6__

write_file "$PACK_DIR/skills/stripe-webhook-idempotency-build.md" <<'__USB_SKILL_E8693437C78BDACD__'
---
description: "[Stripe Webhook Idempotency] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery."
slug: stripe-webhook-idempotency-build
name: Stripe Webhook Idempotency: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:stripe-webhook-idempotency, workflow:build, implementation, stripe, webhook, payments
---

# Stripe Webhook Idempotency: Build

[Stripe Webhook Idempotency] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..

## When to use it
Write or modify code for "Stripe Webhook Idempotency". The typical output is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Keep the best practice in mind: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Verify with: stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check.

## Protocol
You are implementing a change for Stripe Webhook Idempotency. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Follow the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Run stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement Webhook handler / idempotency key check / event deduplication / failed payment recovery" — write patches in the correct dependency order, verified with stripe trigger payment_intent.succeeded.
- "Add Stripe Webhook Idempotency support" — build incrementally, each step independently testable.
__USB_SKILL_E8693437C78BDACD__

write_file "$PACK_DIR/skills/supabase-rls-build.md" <<'__USB_SKILL_9EFA88097EDE2EC6__'
---
description: "[Supabase Row-Level Security] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets RLS policy / policy test / security definer function / admin bypass."
slug: supabase-rls-build
name: Supabase Row-Level Security: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:supabase-rls, workflow:build, implementation, supabase, rls, security
---

# Supabase Row-Level Security: Build

[Supabase Row-Level Security] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..

## When to use it
Write or modify code for "Supabase Row-Level Security". The typical output is RLS policy / policy test / security definer function / admin bypass. Keep the best practice in mind: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Verify with: supabase db check + supabase db test + RLS policy review with pg_policies.

## Protocol
You are implementing a change for Supabase Row-Level Security. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is RLS policy / policy test / security definer function / admin bypass. Follow the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Run supabase db check + supabase db test + RLS policy review with pg_policies after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / policy test / security definer function / admin bypass this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement RLS policy / policy test / security definer function / admin bypass" — write patches in the correct dependency order, verified with supabase db check.
- "Add Supabase Row-Level Security support" — build incrementally, each step independently testable.
__USB_SKILL_9EFA88097EDE2EC6__

write_file "$PACK_DIR/skills/terraform-state-build.md" <<'__USB_SKILL_013AEA51CC4FBA29__'
---
description: "[Terraform State Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets backend config / state migration plan / state locking config / remote state datasource."
slug: terraform-state-build
name: Terraform State Management: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:terraform-state, workflow:build, implementation, terraform, state, iac
---

# Terraform State Management: Build

[Terraform State Management] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..

## When to use it
Write or modify code for "Terraform State Management". The typical output is backend config / state migration plan / state locking config / remote state datasource. Keep the best practice in mind: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Verify with: terraform plan + terraform state list + terraform state pull | jq.

## Protocol
You are implementing a change for Terraform State Management. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is backend config / state migration plan / state locking config / remote state datasource. Follow the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Run terraform plan + terraform state list + terraform state pull | jq after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific backend config / state migration plan / state locking config / remote state datasource this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement backend config / state migration plan / state locking config / remote state datasource" — write patches in the correct dependency order, verified with terraform plan.
- "Add Terraform State Management support" — build incrementally, each step independently testable.
__USB_SKILL_013AEA51CC4FBA29__

write_file "$PACK_DIR/skills/typescript-generics-build.md" <<'__USB_SKILL_72B9F7D48E15E2BC__'
---
description: "[TypeScript Generics & Advanced Types] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets generic type / conditional type / mapped type / branded type."
slug: typescript-generics-build
name: TypeScript Generics & Advanced Types: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:typescript-generics, workflow:build, implementation, typescript, generics, type-system
---

# TypeScript Generics & Advanced Types: Build

[TypeScript Generics & Advanced Types] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..

## When to use it
Write or modify code for "TypeScript Generics & Advanced Types". The typical output is generic type / conditional type / mapped type / branded type. Keep the best practice in mind: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Verify with: tsc --noEmit --strict + type tests with expect-type.

## Protocol
You are implementing a change for TypeScript Generics & Advanced Types. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is generic type / conditional type / mapped type / branded type. Follow the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Run tsc --noEmit --strict + type tests with expect-type after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific generic type / conditional type / mapped type / branded type this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement generic type / conditional type / mapped type / branded type" — write patches in the correct dependency order, verified with tsc --noEmit --strict.
- "Add TypeScript Generics & Advanced Types support" — build incrementally, each step independently testable.
__USB_SKILL_72B9F7D48E15E2BC__

write_file "$PACK_DIR/skills/user-onboarding-flow-build.md" <<'__USB_SKILL_8E94675775F9FCC2__'
---
description: "[User Onboarding Flow Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec."
slug: user-onboarding-flow-build
name: User Onboarding Flow Design: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:user-onboarding-flow, workflow:build, implementation, ux, onboarding, product
---

# User Onboarding Flow Design: Build

[User Onboarding Flow Design] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..

## When to use it
Write or modify code for "User Onboarding Flow Design". The typical output is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Keep the best practice in mind: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Verify with: analytics funnel analysis + onboarding completion rate + drop-off heatmap.

## Protocol
You are implementing a change for User Onboarding Flow Design. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Follow the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Run analytics funnel analysis + onboarding completion rate + drop-off heatmap after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement onboarding wizard / feature checklist / in-app guide / first-run experience spec" — write patches in the correct dependency order, verified with analytics funnel analysis.
- "Add User Onboarding Flow Design support" — build incrementally, each step independently testable.
__USB_SKILL_8E94675775F9FCC2__

write_file "$PACK_DIR/skills/vercel-env-vars-build.md" <<'__USB_SKILL_AC09AA9525CCEC4B__'
---
description: "[Vercel Environment Variables] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets vercel.json env group / preview env config / Edge Config / KV store."
slug: vercel-env-vars-build
name: Vercel Environment Variables: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:vercel-env-vars, workflow:build, implementation, vercel, env, deployment
---

# Vercel Environment Variables: Build

[Vercel Environment Variables] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..

## When to use it
Write or modify code for "Vercel Environment Variables". The typical output is vercel.json env group / preview env config / Edge Config / KV store. Keep the best practice in mind: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Verify with: vercel env pull + vercel list + project settings audit.

## Protocol
You are implementing a change for Vercel Environment Variables. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is vercel.json env group / preview env config / Edge Config / KV store. Follow the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Run vercel env pull + vercel list + project settings audit after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific vercel.json env group / preview env config / Edge Config / KV store this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement vercel.json env group / preview env config / Edge Config / KV store" — write patches in the correct dependency order, verified with vercel env pull.
- "Add Vercel Environment Variables support" — build incrementally, each step independently testable.
__USB_SKILL_AC09AA9525CCEC4B__

write_file "$PACK_DIR/skills/web-scraping-ethics-build.md" <<'__USB_SKILL_051AF68E85C61878__'
---
description: "[Web Scraping Ethics & Compliance] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper."
slug: web-scraping-ethics-build
name: Web Scraping Ethics & Compliance: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:web-scraping-ethics, workflow:build, implementation, scraping, ethics, research
---

# Web Scraping Ethics & Compliance: Build

[Web Scraping Ethics & Compliance] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..

## When to use it
Write or modify code for "Web Scraping Ethics & Compliance". The typical output is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Keep the best practice in mind: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Verify with: curl robots.txt + wget --wait + scraper log audit.

## Protocol
You are implementing a change for Web Scraping Ethics & Compliance. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Follow the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Run curl robots.txt + wget --wait + scraper log audit after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement robots.txt check / polite scraper / rate-limited crawler / cached scraper" — write patches in the correct dependency order, verified with curl robots.txt.
- "Add Web Scraping Ethics & Compliance support" — build incrementally, each step independently testable.
__USB_SKILL_051AF68E85C61878__

write_file "$PACK_DIR/skills/websocket-reconnection-build.md" <<'__USB_SKILL_41A931DE9B8CB431__'
---
description: "[WebSocket Reconnection Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets WebSocket client / reconnection logic / heartbeat / connection status component."
slug: websocket-reconnection-build
name: WebSocket Reconnection Strategies: Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:websocket-reconnection, workflow:build, implementation, websocket, realtime, frontend
---

# WebSocket Reconnection Strategies: Build

[WebSocket Reconnection Strategies] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..

## When to use it
Write or modify code for "WebSocket Reconnection Strategies". The typical output is WebSocket client / reconnection logic / heartbeat / connection status component. Keep the best practice in mind: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Verify with: Browser DevTools Network tab WS filter + reconnection test with server restart.

## Protocol
You are implementing a change for WebSocket Reconnection Strategies. Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is WebSocket client / reconnection logic / heartbeat / connection status component. Follow the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Run Browser DevTools Network tab WS filter + reconnection test with server restart after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement WebSocket client / reconnection logic / heartbeat / connection status component" — write patches in the correct dependency order, verified with Browser DevTools Network tab WS filter.
- "Add WebSocket Reconnection Strategies support" — build incrementally, each step independently testable.
__USB_SKILL_41A931DE9B8CB431__

write_file "$PACK_DIR/skills/web-vitals-optimization-build.md" <<'__USB_SKILL_3AB28C915AC67FAF__'
---
description: "[Web Vitals Optimisation (LCP/CLS/INP)] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis."
slug: web-vitals-optimization-build
name: Web Vitals Optimisation (LCP/CLS/INP): Build
category: Implementation
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:web-vitals-optimization, workflow:build, implementation, performance, web-vitals, optimisation
---

# Web Vitals Optimisation (LCP/CLS/INP): Build

[Web Vitals Optimisation (LCP/CLS/INP)] Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..

## When to use it
Write or modify code for "Web Vitals Optimisation (LCP/CLS/INP)". The typical output is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Keep the best practice in mind: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Verify with: Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension.

## Protocol
You are implementing a change for Web Vitals Optimisation (LCP/CLS/INP). Write or refactor code in small, independently verifiable patches. Each patch must include a validation step. Build dependencies first (types, schemas, core logic), then integrations (API, state), then presentation (UI), and finally polish.. The target output is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Follow the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Run Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension after each patch.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves.

## Output contract
- **patchPlan** (diff): File-level change or patch plan.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Implement image optimisation / font display swap / critical CSS / lazy load / bundle analysis" — write patches in the correct dependency order, verified with Lighthouse CI.
- "Add Web Vitals Optimisation (LCP/CLS/INP) support" — build incrementally, each step independently testable.
__USB_SKILL_3AB28C915AC67FAF__

write_file "$PACK_DIR/skills/adapter-smith.md" <<'__USB_SKILL_525AA1EDCE8B9B57__'
---
description: "Converts any skill definition between agent runtime formats — Claude markdown, Hermes manifest, OpenAI tool descriptors, Cursor rules, LangChain registry, or MCP resources. Preserves the semantic contract across all formats. Call this when you need to move a skill to a different agent system, or to produce a cross-platform export of the entire catalog."
slug: adapter-smith
name: Adapter Smith
category: Integration
risk: low
model_agnostic: true
agent_agnostic: true
tags: adapter, converter, cross-platform
---

# Adapter Smith

Converts any skill definition between agent runtime formats — Claude markdown, Hermes manifest, OpenAI tool descriptors, Cursor rules, LangChain registry, or MCP resources. Preserves the semantic contract across all formats.

## When to use it
Call this when you need to move a skill to a different agent system, or to produce a cross-platform export of the entire catalog.

## Protocol
Identify the source skill format and the target runtime. Map each field: slug → file name, trigger → tool description, inputs → parameter schema, outputs → response contract, examples → usage hints. Preserve all risk markers and model-agnostic guarantees. If the target format lacks a field, embed it in a comment or description field. Output the complete adapter payload.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **targetRuntime** (selection, required): claude, hermes, openai, langchain, cursor, mcp or generic.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **commands** (command): Safe execution, verification or automation commands.

## Examples
- Convert all 409 skills from Claude markdown to Hermes manifest format.
- Export the 'intent-router' skill as an OpenAI function tool descriptor.
__USB_SKILL_525AA1EDCE8B9B57__

write_file "$PACK_DIR/skills/api-contract-smith.md" <<'__USB_SKILL_D94331F207B9C5BD__'
---
description: "Designs a minimal, secure API contract for integrating an external service or internal endpoint. Specifies authentication, error contracts, rate limits, idempotency, and a proxy route for server-side secret handling. Call this when integrating a new API, designing a service boundary, or refactoring an existing endpoint contract."
slug: api-contract-smith
name: API Contract Smith
category: Integration
risk: medium
model_agnostic: true
agent_agnostic: true
tags: api, contract, integration, proxy
---

# API Contract Smith

Designs a minimal, secure API contract for integrating an external service or internal endpoint. Specifies authentication, error contracts, rate limits, idempotency, and a proxy route for server-side secret handling.

## When to use it
Call this when integrating a new API, designing a service boundary, or refactoring an existing endpoint contract.

## Protocol
Document the service purpose and authentication mechanism. List all endpoints with request and response shapes. For each endpoint: define success/error response codes, pagination (if any), rate limit headers, and idempotency key. Mandate that all secrets live in environment variables accessible only server-side. Produce a minimal Express/Next.js route that proxies the external API while stripping secrets from client payloads.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **apiDocs** (url, optional): API documentation or reference link, if available.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- Design a Stripe payment proxy: /api/checkout creates a session, /api/webhook verifies signature, /api/portal generates customer portal link.
- Contract for a weather service: single GET endpoint, API key in Authorization header, 1000 req/day limit, 429 response on overage.
__USB_SKILL_D94331F207B9C5BD__

write_file "$PACK_DIR/skills/a-b-testing-framework-tune.md" <<'__USB_SKILL_75E95FBE1342127B__'
---
description: "[A/B Testing Framework] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets experiment spec / variant assignment / metric definition / statistical analysis script."
slug: a-b-testing-framework-tune
name: A/B Testing Framework: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:a-b-testing-framework, workflow:tune, optimization, ab-testing, experiments, product
---

# A/B Testing Framework: Tune

[A/B Testing Framework] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..

## When to use it
Optimize "A/B Testing Framework". Target the failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise." or the typical verification command statsmodels sample size calculation + Bayesian A/B test + sequential testing. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising A/B Testing Framework. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is experiment spec / variant assignment / metric definition / statistical analysis script. Measure using statsmodels sample size calculation + Bayesian A/B test + sequential testing. Guard against: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise A/B Testing Framework" — benchmark statsmodels sample size calculation before and after.
- "Tune experiment spec / variant assignment / metric definition / statistical analysis script performance" — reduce cost/latency while monitoring Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.
__USB_SKILL_75E95FBE1342127B__

write_file "$PACK_DIR/skills/a11y-aria-patterns-tune.md" <<'__USB_SKILL_9021889437664D33__'
---
description: "[Accessibility ARIA Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script."
slug: a11y-aria-patterns-tune
name: Accessibility ARIA Patterns: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:a11y-aria-patterns, workflow:tune, optimization, accessibility, aria, testing
---

# Accessibility ARIA Patterns: Tune

[Accessibility ARIA Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..

## When to use it
Optimize "Accessibility ARIA Patterns". Target the failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers." or the typical verification command axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Accessibility ARIA Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Measure using axe-core + WAVE tool + VoiceOver/NVDA manual test + keyboard-only audit. Guard against: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Accessibility ARIA Patterns" — benchmark axe-core before and after.
- "Tune ARIA attribute refactor / keyboard navigation / focus management / screen reader test script performance" — reduce cost/latency while monitoring Adding ARIA attributes that conflict with native HTML semantics (e.
__USB_SKILL_9021889437664D33__

write_file "$PACK_DIR/skills/agent-tool-binding-tune.md" <<'__USB_SKILL_BAAE1CE97B5F11AD__'
---
description: "[Agent Tool Binding & Dispatch] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets router tool / domain group / dynamic tool injection / tool usage statistics."
slug: agent-tool-binding-tune
name: Agent Tool Binding & Dispatch: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:agent-tool-binding, workflow:tune, optimization, agents, tool-binding, orchestration
---

# Agent Tool Binding & Dispatch: Tune

[Agent Tool Binding & Dispatch] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..

## When to use it
Optimize "Agent Tool Binding & Dispatch". Target the failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly." or the typical verification command agent trace log + tool invocation frequency analysis + token cost audit. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Agent Tool Binding & Dispatch. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is router tool / domain group / dynamic tool injection / tool usage statistics. Measure using agent trace log + tool invocation frequency analysis + token cost audit. Guard against: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Agent Tool Binding & Dispatch" — benchmark agent trace log before and after.
- "Tune router tool / domain group / dynamic tool injection / tool usage statistics performance" — reduce cost/latency while monitoring Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.
__USB_SKILL_BAAE1CE97B5F11AD__

write_file "$PACK_DIR/skills/analytics-metric-definition-tune.md" <<'__USB_SKILL_53A3BB224B5BA8B0__'
---
description: "[Analytics Metric Definitions] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation."
slug: analytics-metric-definition-tune
name: Analytics Metric Definitions: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:analytics-metric-definition, workflow:tune, optimization, analytics, metrics, data
---

# Analytics Metric Definitions: Tune

[Analytics Metric Definitions] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..

## When to use it
Optimize "Analytics Metric Definitions". Target the failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers." or the typical verification command dbt docs generate + dbt test --select tag:metrics + metric comparison script. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Analytics Metric Definitions. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is metric definition / dbt model / SQL logic / dashboard tile / documentation. Measure using dbt docs generate + dbt test --select tag:metrics + metric comparison script. Guard against: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Analytics Metric Definitions" — benchmark dbt docs generate before and after.
- "Tune metric definition / dbt model / SQL logic / dashboard tile / documentation performance" — reduce cost/latency while monitoring Different teams computing the same metric (e.
__USB_SKILL_53A3BB224B5BA8B0__

write_file "$PACK_DIR/skills/adr-documentation-tune.md" <<'__USB_SKILL_4F3B87E6B4DD7A42__'
---
description: "[Architecture Decision Records] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets ADR document / decision log / template / review workflow."
slug: adr-documentation-tune
name: Architecture Decision Records: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:adr-documentation, workflow:tune, optimization, documentation, adr, architecture
---

# Architecture Decision Records: Tune

[Architecture Decision Records] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..

## When to use it
Optimize "Architecture Decision Records". Target the failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done." or the typical verification command adr-tools list + adr-tools generate + decision log index page. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Architecture Decision Records. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is ADR document / decision log / template / review workflow. Measure using adr-tools list + adr-tools generate + decision log index page. Guard against: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ADR document / decision log / template / review workflow this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Architecture Decision Records" — benchmark adr-tools list before and after.
- "Tune ADR document / decision log / template / review workflow performance" — reduce cost/latency while monitoring Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.
__USB_SKILL_4F3B87E6B4DD7A42__

write_file "$PACK_DIR/skills/aws-lambda-cold-start-tune.md" <<'__USB_SKILL_0CC4213AD4EF2481__'
---
description: "[AWS Lambda Cold Starts] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function."
slug: aws-lambda-cold-start-tune
name: AWS Lambda Cold Starts: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:aws-lambda-cold-start, workflow:tune, optimization, aws, lambda, performance
---

# AWS Lambda Cold Starts: Tune

[AWS Lambda Cold Starts] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..

## When to use it
Optimize "AWS Lambda Cold Starts". Target the failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler." or the typical verification command AWS X-Ray trace + Lambda Insights + cold start dashboard. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising AWS Lambda Cold Starts. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Measure using AWS X-Ray trace + Lambda Insights + cold start dashboard. Guard against: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise AWS Lambda Cold Starts" — benchmark AWS X-Ray trace before and after.
- "Tune handler refactor / SnapStart config / Provisioned Concurrency / warmer function performance" — reduce cost/latency while monitoring Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.
__USB_SKILL_0CC4213AD4EF2481__

write_file "$PACK_DIR/skills/azure-bicep-tune.md" <<'__USB_SKILL_0DA1E3A2EC239CAA__'
---
description: "[Azure Bicep Infrastructure] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets main.bicep / module / parameter file / azd template."
slug: azure-bicep-tune
name: Azure Bicep Infrastructure: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:azure-bicep, workflow:tune, optimization, azure, bicep, iac
---

# Azure Bicep Infrastructure: Tune

[Azure Bicep Infrastructure] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..

## When to use it
Optimize "Azure Bicep Infrastructure". Target the failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce." or the typical verification command az deployment group validate + az what-if + bicep build. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Azure Bicep Infrastructure. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is main.bicep / module / parameter file / azd template. Measure using az deployment group validate + az what-if + bicep build. Guard against: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific main.bicep / module / parameter file / azd template this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Azure Bicep Infrastructure" — benchmark az deployment group validate before and after.
- "Tune main.bicep / module / parameter file / azd template performance" — reduce cost/latency while monitoring Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.
__USB_SKILL_0DA1E3A2EC239CAA__

write_file "$PACK_DIR/skills/browser-devtools-tune.md" <<'__USB_SKILL_487F93C32E3B6651__'
---
description: "[Browser DevTools & Debugging] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot."
slug: browser-devtools-tune
name: Browser DevTools & Debugging: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:browser-devtools, workflow:tune, optimization, browser, debugging, devtools
---

# Browser DevTools & Debugging: Tune

[Browser DevTools & Debugging] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..

## When to use it
Optimize "Browser DevTools & Debugging". Target the failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically." or the typical verification command Chrome DevTools performance recording + memory heap snapshot + network throttle. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Browser DevTools & Debugging. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is debugging workflow / breakpoint guide / performance recording / memory snapshot. Measure using Chrome DevTools performance recording + memory heap snapshot + network throttle. Guard against: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Browser DevTools & Debugging" — benchmark Chrome DevTools performance recording before and after.
- "Tune debugging workflow / breakpoint guide / performance recording / memory snapshot performance" — reduce cost/latency while monitoring Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.
__USB_SKILL_487F93C32E3B6651__

write_file "$PACK_DIR/skills/cli-tool-design-tune.md" <<'__USB_SKILL_158CA494CDAF1A6D__'
---
description: "[CLI Tool Design Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CLI scaffolding / argument parser / exit code handler / --json output mode."
slug: cli-tool-design-tune
name: CLI Tool Design Patterns: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cli-tool-design, workflow:tune, optimization, cli, devtools, scripting
---

# CLI Tool Design Patterns: Tune

[CLI Tool Design Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..

## When to use it
Optimize "CLI Tool Design Patterns". Target the failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with." or the typical verification command echo $? after CLI run + stderr redirection test + --json output validation. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising CLI Tool Design Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is CLI scaffolding / argument parser / exit code handler / --json output mode. Measure using echo $? after CLI run + stderr redirection test + --json output validation. Guard against: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise CLI Tool Design Patterns" — benchmark echo $? after CLI run before and after.
- "Tune CLI scaffolding / argument parser / exit code handler / --json output mode performance" — reduce cost/latency while monitoring Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.
__USB_SKILL_158CA494CDAF1A6D__

write_file "$PACK_DIR/skills/cloud-cost-optimization-tune.md" <<'__USB_SKILL_086ADB476C48FEC3__'
---
description: "[Cloud Cost Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report."
slug: cloud-cost-optimization-tune
name: Cloud Cost Optimisation: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cloud-cost-optimization, workflow:tune, optimization, cloud, cost
---

# Cloud Cost Optimisation: Tune

[Cloud Cost Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..

## When to use it
Optimize "Cloud Cost Optimisation". Target the failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours." or the typical verification command cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Cloud Cost Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Measure using cloud cost explorer + instance utilisation report + auto-stop Lambda function test. Guard against: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Cloud Cost Optimisation" — benchmark cloud cost explorer before and after.
- "Tune right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report performance" — reduce cost/latency while monitoring Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.
__USB_SKILL_086ADB476C48FEC3__

write_file "$PACK_DIR/skills/code-review-checklist-tune.md" <<'__USB_SKILL_9CC3F27001148AD3__'
---
description: "[Code Review Checklist] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets review checklist / automated review comment / risk classification / diff summary."
slug: code-review-checklist-tune
name: Code Review Checklist: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:code-review-checklist, workflow:tune, optimization, code-review, quality, checklist
---

# Code Review Checklist: Tune

[Code Review Checklist] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..

## When to use it
Optimize "Code Review Checklist". Target the failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions." or the typical verification command git diff --stat + lint-staged + danger.js automated review + commitlint. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Code Review Checklist. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is review checklist / automated review comment / risk classification / diff summary. Measure using git diff --stat + lint-staged + danger.js automated review + commitlint. Guard against: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific review checklist / automated review comment / risk classification / diff summary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Code Review Checklist" — benchmark git diff --stat before and after.
- "Tune review checklist / automated review comment / risk classification / diff summary performance" — reduce cost/latency while monitoring Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.
__USB_SKILL_9CC3F27001148AD3__

write_file "$PACK_DIR/skills/convex-functions-tune.md" <<'__USB_SKILL_E12CF3AC5489508A__'
---
description: "[Convex Functions & Mutations] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets mutation / query / action / component / scheduler job."
slug: convex-functions-tune
name: Convex Functions & Mutations: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:convex-functions, workflow:tune, optimization, convex, realtime, backend
---

# Convex Functions & Mutations: Tune

[Convex Functions & Mutations] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..

## When to use it
Optimize "Convex Functions & Mutations". Target the failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients." or the typical verification command npx convex dev + dashboard OCC conflict log + custom retry logic. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Convex Functions & Mutations. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is mutation / query / action / component / scheduler job. Measure using npx convex dev + dashboard OCC conflict log + custom retry logic. Guard against: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific mutation / query / action / component / scheduler job this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Convex Functions & Mutations" — benchmark npx convex dev before and after.
- "Tune mutation / query / action / component / scheduler job performance" — reduce cost/latency while monitoring Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.
__USB_SKILL_E12CF3AC5489508A__

write_file "$PACK_DIR/skills/cron-job-reliability-tune.md" <<'__USB_SKILL_C81198A9897A7847__'
---
description: "[Cron Job & Scheduled Task Reliability] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets crontab entry / log rotation / idempotency guard / failure alert integration."
slug: cron-job-reliability-tune
name: Cron Job & Scheduled Task Reliability: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:cron-job-reliability, workflow:tune, optimization, cron, scheduling, reliability
---

# Cron Job & Scheduled Task Reliability: Tune

[Cron Job & Scheduled Task Reliability] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..

## When to use it
Optimize "Cron Job & Scheduled Task Reliability". Target the failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time." or the typical verification command tail -f /var/log/cron + systemctl status cron + idempotency test script. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Cron Job & Scheduled Task Reliability. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is crontab entry / log rotation / idempotency guard / failure alert integration. Measure using tail -f /var/log/cron + systemctl status cron + idempotency test script. Guard against: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Cron Job & Scheduled Task Reliability" — benchmark tail -f /var/log/cron before and after.
- "Tune crontab entry / log rotation / idempotency guard / failure alert integration performance" — reduce cost/latency while monitoring Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.
__USB_SKILL_C81198A9897A7847__

write_file "$PACK_DIR/skills/css-layout-tune.md" <<'__USB_SKILL_750514F15F0E5323__'
---
description: "[CSS Layout & Responsiveness] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CSS layout refactor / responsive grid / container query implementation."
slug: css-layout-tune
name: CSS Layout & Responsiveness: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:css-layout, workflow:tune, optimization, css, layout, frontend
---

# CSS Layout & Responsiveness: Tune

[CSS Layout & Responsiveness] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..

## When to use it
Optimize "CSS Layout & Responsiveness". Target the failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable." or the typical verification command Lighthouse mobile emulation + browser DevTools responsive mode. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising CSS Layout & Responsiveness. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is CSS layout refactor / responsive grid / container query implementation. Measure using Lighthouse mobile emulation + browser DevTools responsive mode. Guard against: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSS layout refactor / responsive grid / container query implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise CSS Layout & Responsiveness" — benchmark Lighthouse mobile emulation before and after.
- "Tune CSS layout refactor / responsive grid / container query implementation performance" — reduce cost/latency while monitoring Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.
__USB_SKILL_750514F15F0E5323__

write_file "$PACK_DIR/skills/csv-data-cleaning-tune.md" <<'__USB_SKILL_FEE902228F781BCD__'
---
description: "[CSV Data Cleaning Pipeline] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CSV parser / row validator / column type mapper / error report / cleaned output."
slug: csv-data-cleaning-tune
name: CSV Data Cleaning Pipeline: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:csv-data-cleaning, workflow:tune, optimization, data, csv, pipeline
---

# CSV Data Cleaning Pipeline: Tune

[CSV Data Cleaning Pipeline] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..

## When to use it
Optimize "CSV Data Cleaning Pipeline". Target the failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines." or the typical verification command python3 -c csv.DictReader + validation script + row count diff. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising CSV Data Cleaning Pipeline. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is CSV parser / row validator / column type mapper / error report / cleaned output. Measure using python3 -c csv.DictReader + validation script + row count diff. Guard against: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise CSV Data Cleaning Pipeline" — benchmark python3 -c csv.DictReader before and after.
- "Tune CSV parser / row validator / column type mapper / error report / cleaned output performance" — reduce cost/latency while monitoring Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.
__USB_SKILL_FEE902228F781BCD__

write_file "$PACK_DIR/skills/database-migration-safety-tune.md" <<'__USB_SKILL_D485DB0919781C4E__'
---
description: "[Database Migration Safety] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan."
slug: database-migration-safety-tune
name: Database Migration Safety: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:database-migration-safety, workflow:tune, optimization, database, migration, safety
---

# Database Migration Safety: Tune

[Database Migration Safety] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..

## When to use it
Optimize "Database Migration Safety". Target the failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users." or the typical verification command pg_locks monitoring during migration + batch backfill script + rollback test. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Database Migration Safety. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Measure using pg_locks monitoring during migration + batch backfill script + rollback test. Guard against: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Database Migration Safety" — benchmark pg_locks monitoring during migration before and after.
- "Tune batch migration / expand-contract pattern / zero-downtime migration / rollback plan performance" — reduce cost/latency while monitoring Running a long-running migration (e.
__USB_SKILL_D485DB0919781C4E__

write_file "$PACK_DIR/skills/data-warehouse-schema-tune.md" <<'__USB_SKILL_57FCBE6F7C721BF0__'
---
description: "[Data Warehouse Schema Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets star schema / fact table / dimension table / ETL pipeline spec."
slug: data-warehouse-schema-tune
name: Data Warehouse Schema Design: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:data-warehouse-schema, workflow:tune, optimization, data, warehouse, schema
---

# Data Warehouse Schema Design: Tune

[Data Warehouse Schema Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..

## When to use it
Optimize "Data Warehouse Schema Design". Target the failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries." or the typical verification command dbt run + dbt test + query profiling with warehouse-native tools. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Data Warehouse Schema Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is star schema / fact table / dimension table / ETL pipeline spec. Measure using dbt run + dbt test + query profiling with warehouse-native tools. Guard against: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific star schema / fact table / dimension table / ETL pipeline spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Data Warehouse Schema Design" — benchmark dbt run before and after.
- "Tune star schema / fact table / dimension table / ETL pipeline spec performance" — reduce cost/latency while monitoring Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.
__USB_SKILL_57FCBE6F7C721BF0__

write_file "$PACK_DIR/skills/design-token-system-tune.md" <<'__USB_SKILL_E38B16F4E9AA0070__'
---
description: "[Design Token Systems] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets token JSON / CSS custom properties / theme switcher / token documentation."
slug: design-token-system-tune
name: Design Token Systems: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:design-token-system, workflow:tune, optimization, design, tokens, components
---

# Design Token Systems: Tune

[Design Token Systems] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..

## When to use it
Optimize "Design Token Systems". Target the failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file." or the typical verification command style-dictionary build + Storybook token viewer + token value comparison. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Design Token Systems. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is token JSON / CSS custom properties / theme switcher / token documentation. Measure using style-dictionary build + Storybook token viewer + token value comparison. Guard against: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Design Token Systems" — benchmark style-dictionary build before and after.
- "Tune token JSON / CSS custom properties / theme switcher / token documentation performance" — reduce cost/latency while monitoring Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.
__USB_SKILL_E38B16F4E9AA0070__

write_file "$PACK_DIR/skills/docker-compose-networking-tune.md" <<'__USB_SKILL_2E78D23836B21FF7__'
---
description: "[Docker Compose Networking] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets docker-compose.yml / network config / healthcheck / depends_on condition."
slug: docker-compose-networking-tune
name: Docker Compose Networking: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:docker-compose-networking, workflow:tune, optimization, docker, networking, devops
---

# Docker Compose Networking: Tune

[Docker Compose Networking] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..

## When to use it
Optimize "Docker Compose Networking". Target the failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name." or the typical verification command docker compose up --wait + docker network inspect + container logs. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Docker Compose Networking. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is docker-compose.yml / network config / healthcheck / depends_on condition. Measure using docker compose up --wait + docker network inspect + container logs. Guard against: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Docker Compose Networking" — benchmark docker compose up --wait before and after.
- "Tune docker-compose.yml / network config / healthcheck / depends_on condition performance" — reduce cost/latency while monitoring Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.
__USB_SKILL_2E78D23836B21FF7__

write_file "$PACK_DIR/skills/docker-multistage-tune.md" <<'__USB_SKILL_38932190316DFCF5__'
---
description: "[Docker Multi-Stage Builds] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets multi-stage Dockerfile / .dockerignore / slim base image switch."
slug: docker-multistage-tune
name: Docker Multi-Stage Builds: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:docker-multistage, workflow:tune, optimization, docker, build, devops
---

# Docker Multi-Stage Builds: Tune

[Docker Multi-Stage Builds] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..

## When to use it
Optimize "Docker Multi-Stage Builds". Target the failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure." or the typical verification command docker build + docker scout + dive layer analysis. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Docker Multi-Stage Builds. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is multi-stage Dockerfile / .dockerignore / slim base image switch. Measure using docker build + docker scout + dive layer analysis. Guard against: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Docker Multi-Stage Builds" — benchmark docker build before and after.
- "Tune multi-stage Dockerfile / .dockerignore / slim base image switch performance" — reduce cost/latency while monitoring Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.
__USB_SKILL_38932190316DFCF5__

write_file "$PACK_DIR/skills/drizzle-schema-design-tune.md" <<'__USB_SKILL_0C715C85531A0D6A__'
---
description: "[Drizzle Schema Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets schema.ts / relation map / migration SQL / Drizzle query builder."
slug: drizzle-schema-design-tune
name: Drizzle Schema Design: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:drizzle-schema-design, workflow:tune, optimization, drizzle, schema, database
---

# Drizzle Schema Design: Tune

[Drizzle Schema Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..

## When to use it
Optimize "Drizzle Schema Design". Target the failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster." or the typical verification command drizzle-kit push + drizzle-kit studio + generated SQL audit. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Drizzle Schema Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is schema.ts / relation map / migration SQL / Drizzle query builder. Measure using drizzle-kit push + drizzle-kit studio + generated SQL audit. Guard against: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Drizzle Schema Design" — benchmark drizzle-kit push before and after.
- "Tune schema.ts / relation map / migration SQL / Drizzle query builder performance" — reduce cost/latency while monitoring Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.
__USB_SKILL_0C715C85531A0D6A__

write_file "$PACK_DIR/skills/error-monitoring-setup-tune.md" <<'__USB_SKILL_880897967B5A326A__'
---
description: "[Error Monitoring & Alerting Setup] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring."
slug: error-monitoring-setup-tune
name: Error Monitoring & Alerting Setup: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:error-monitoring-setup, workflow:tune, optimization, monitoring, errors, alerts
---

# Error Monitoring & Alerting Setup: Tune

[Error Monitoring & Alerting Setup] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..

## When to use it
Optimize "Error Monitoring & Alerting Setup". Target the failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains." or the typical verification command Sentry API error list + alert rule test + source map validation. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Error Monitoring & Alerting Setup. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Measure using Sentry API error list + alert rule test + source map validation. Guard against: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Error Monitoring & Alerting Setup" — benchmark Sentry API error list before and after.
- "Tune Sentry project config / alert rule / error grouping / source map upload / performance monitoring performance" — reduce cost/latency while monitoring Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.
__USB_SKILL_880897967B5A326A__

write_file "$PACK_DIR/skills/fastapi-dependencies-tune.md" <<'__USB_SKILL_FC25C5A8E6637254__'
---
description: "[FastAPI Dependency Injection] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets dependency / lifespan handler / override for testing."
slug: fastapi-dependencies-tune
name: FastAPI Dependency Injection: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:fastapi-dependencies, workflow:tune, optimization, fastapi, dependencies, api
---

# FastAPI Dependency Injection: Tune

[FastAPI Dependency Injection] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..

## When to use it
Optimize "FastAPI Dependency Injection". Target the failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection." or the typical verification command uvicorn --reload + /docs interactive test + dependency graph visualisation. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising FastAPI Dependency Injection. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is dependency / lifespan handler / override for testing. Measure using uvicorn --reload + /docs interactive test + dependency graph visualisation. Guard against: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific dependency / lifespan handler / override for testing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise FastAPI Dependency Injection" — benchmark uvicorn --reload before and after.
- "Tune dependency / lifespan handler / override for testing performance" — reduce cost/latency while monitoring Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.
__USB_SKILL_FC25C5A8E6637254__

write_file "$PACK_DIR/skills/feature-flags-tune.md" <<'__USB_SKILL_0E267DA06220CDD2__'
---
description: "[Feature Flags & Gradual Rollouts] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag."
slug: feature-flags-tune
name: Feature Flags & Gradual Rollouts: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:feature-flags, workflow:tune, optimization, feature-flags, rollout, devops
---

# Feature Flags & Gradual Rollouts: Tune

[Feature Flags & Gradual Rollouts] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..

## When to use it
Optimize "Feature Flags & Gradual Rollouts". Target the failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags." or the typical verification command flag evaluation log + rollout percentage monitoring + unused flag scan. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Feature Flags & Gradual Rollouts. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Measure using flag evaluation log + rollout percentage monitoring + unused flag scan. Guard against: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Feature Flags & Gradual Rollouts" — benchmark flag evaluation log before and after.
- "Tune flag provider config / gradual rollout target / flag cleanup plan / A/B test flag performance" — reduce cost/latency while monitoring Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.
__USB_SKILL_0E267DA06220CDD2__

write_file "$PACK_DIR/skills/git-conflict-resolution-tune.md" <<'__USB_SKILL_A5B6E58A9506566C__'
---
description: "[Git Conflict Resolution] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message."
slug: git-conflict-resolution-tune
name: Git Conflict Resolution: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:git-conflict-resolution, workflow:tune, optimization, git, conflicts, workflow
---

# Git Conflict Resolution: Tune

[Git Conflict Resolution] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..

## When to use it
Optimize "Git Conflict Resolution". Target the failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs." or the typical verification command git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Git Conflict Resolution. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Measure using git log --oneline -5 -- <file> + git diff HEAD...MERGE_HEAD + git rerere. Guard against: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Git Conflict Resolution" — benchmark git log --oneline -5 -- <file> before and after.
- "Tune conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message performance" — reduce cost/latency while monitoring Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.
__USB_SKILL_A5B6E58A9506566C__

write_file "$PACK_DIR/skills/github-actions-pipeline-tune.md" <<'__USB_SKILL_FCADA15AF2D1E864__'
---
description: "[GitHub Actions Pipeline Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets workflow YAML / cache config / matrix build / conditional job execution."
slug: github-actions-pipeline-tune
name: GitHub Actions Pipeline Optimisation: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:github-actions-pipeline, workflow:tune, optimization, github-actions, ci, devops
---

# GitHub Actions Pipeline Optimisation: Tune

[GitHub Actions Pipeline Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..

## When to use it
Optimize "GitHub Actions Pipeline Optimisation". Target the failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope." or the typical verification command act --job test + cache hit/miss analysis + workflow graph visualisation. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising GitHub Actions Pipeline Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is workflow YAML / cache config / matrix build / conditional job execution. Measure using act --job test + cache hit/miss analysis + workflow graph visualisation. Guard against: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific workflow YAML / cache config / matrix build / conditional job execution this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise GitHub Actions Pipeline Optimisation" — benchmark act --job test before and after.
- "Tune workflow YAML / cache config / matrix build / conditional job execution performance" — reduce cost/latency while monitoring Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.
__USB_SKILL_FCADA15AF2D1E864__

write_file "$PACK_DIR/skills/graphql-n-plus-one-tune.md" <<'__USB_SKILL_974A07853FC5086B__'
---
description: "[GraphQL N+1 Query Prevention] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis."
slug: graphql-n-plus-one-tune
name: GraphQL N+1 Query Prevention: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:graphql-n-plus-one, workflow:tune, optimization, graphql, n-plus-one, performance
---

# GraphQL N+1 Query Prevention: Tune

[GraphQL N+1 Query Prevention] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..

## When to use it
Optimize "GraphQL N+1 Query Prevention". Target the failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children." or the typical verification command graphql query with tracing + DataLoader statistics + SQL log analysis. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising GraphQL N+1 Query Prevention. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Measure using graphql query with tracing + DataLoader statistics + SQL log analysis. Guard against: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise GraphQL N+1 Query Prevention" — benchmark graphql query with tracing before and after.
- "Tune DataLoader instance / batch load function / resolver refactor / query complexity analysis performance" — reduce cost/latency while monitoring A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.
__USB_SKILL_974A07853FC5086B__

write_file "$PACK_DIR/skills/jest-test-optimization-tune.md" <<'__USB_SKILL_D81667027F142A67__'
---
description: "[Jest Test Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking."
slug: jest-test-optimization-tune
name: Jest Test Optimisation: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:jest-test-optimization, workflow:tune, optimization, jest, testing, optimisation
---

# Jest Test Optimisation: Tune

[Jest Test Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..

## When to use it
Optimize "Jest Test Optimisation". Target the failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes." or the typical verification command jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Jest Test Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Measure using jest --changedSince=main --json + jest --onlyChanged + jest-coverage threshold check. Guard against: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Jest Test Optimisation" — benchmark jest --changedSince=main --json before and after.
- "Tune jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking performance" — reduce cost/latency while monitoring Running the entire test suite on every change, taking minutes even for small incremental code changes.
__USB_SKILL_D81667027F142A67__

write_file "$PACK_DIR/skills/json-schema-validation-tune.md" <<'__USB_SKILL_326E8C09E935A521__'
---
description: "[JSON Schema Validation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets JSON Schema / validator middleware / type guard / error message / response parser."
slug: json-schema-validation-tune
name: JSON Schema Validation: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:json-schema-validation, workflow:tune, optimization, json, validation, api
---

# JSON Schema Validation: Tune

[JSON Schema Validation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..

## When to use it
Optimize "JSON Schema Validation". Target the failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly." or the typical verification command ajv validate + JSON Schema test suite + response mock test. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising JSON Schema Validation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is JSON Schema / validator middleware / type guard / error message / response parser. Measure using ajv validate + JSON Schema test suite + response mock test. Guard against: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise JSON Schema Validation" — benchmark ajv validate before and after.
- "Tune JSON Schema / validator middleware / type guard / error message / response parser performance" — reduce cost/latency while monitoring Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.
__USB_SKILL_326E8C09E935A521__

write_file "$PACK_DIR/skills/kubernetes-hpa-tune.md" <<'__USB_SKILL_0C2F3965F0DE45AB__'
---
description: "[Kubernetes Horizontal Pod Autoscaling] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config."
slug: kubernetes-hpa-tune
name: Kubernetes Horizontal Pod Autoscaling: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-hpa, workflow:tune, optimization, kubernetes, autoscaling, devops
---

# Kubernetes Horizontal Pod Autoscaling: Tune

[Kubernetes Horizontal Pod Autoscaling] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..

## When to use it
Optimize "Kubernetes Horizontal Pod Autoscaling". Target the failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment." or the typical verification command kubectl get hpa --watch + kubectl top pods + metrics-server logs. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Kubernetes Horizontal Pod Autoscaling. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Measure using kubectl get hpa --watch + kubectl top pods + metrics-server logs. Guard against: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Kubernetes Horizontal Pod Autoscaling" — benchmark kubectl get hpa --watch before and after.
- "Tune HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config performance" — reduce cost/latency while monitoring HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.
__USB_SKILL_0C2F3965F0DE45AB__

write_file "$PACK_DIR/skills/kubernetes-pod-lifecycle-tune.md" <<'__USB_SKILL_CD231318E4F2CA35__'
---
description: "[Kubernetes Pod Lifecycle] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container."
slug: kubernetes-pod-lifecycle-tune
name: Kubernetes Pod Lifecycle: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-pod-lifecycle, workflow:tune, optimization, kubernetes, pods, devops
---

# Kubernetes Pod Lifecycle: Tune

[Kubernetes Pod Lifecycle] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..

## When to use it
Optimize "Kubernetes Pod Lifecycle". Target the failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready." or the typical verification command kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Kubernetes Pod Lifecycle. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Measure using kubectl describe pod + kubectl logs --previous + kubectl get events --sort-by='.lastTimestamp'. Guard against: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Kubernetes Pod Lifecycle" — benchmark kubectl describe pod before and after.
- "Tune deployment.yaml / startup probe / readiness probe / liveness probe / init container performance" — reduce cost/latency while monitoring Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.
__USB_SKILL_CD231318E4F2CA35__

write_file "$PACK_DIR/skills/context-window-budget-tune.md" <<'__USB_SKILL_1DBB45FF97D36975__'
---
description: "[LLM Context Window Budget Management] Measure baseline, optimise with non-breaking changes, measure again, report before/after Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard."
slug: context-window-budget-tune
name: LLM Context Window Budget Management: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:context-window-budget, workflow:tune, optimization, context, tokens, llm, memory, summarization
---

# LLM Context Window Budget Management: Tune

[LLM Context Window Budget Management] Measure baseline, optimise with non-breaking changes, measure again, report before/after Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..

## When to use it
Optimise "LLM Context Window Budget Management". Target the failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness." or the typical verification command tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising LLM Context Window Budget Management. Measure baseline, optimise with non-breaking changes, measure again, report before/after. The target is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Measure using tiktoken count + sliding window function + embedding similarity search + prompt cache hit ratio + token-usage-per-turn telemetry. Guard against: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves.

## Output contract
- **md** (markdown): MD output
- **cmd** (command): CMD output

## Examples
- "Optimise LLM Context Window Budget Management" — benchmark tiktoken count before and after.
- "Tune trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard performance" — reduce cost/latency while monitoring Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content.
__USB_SKILL_1DBB45FF97D36975__

write_file "$PACK_DIR/skills/mcp-tool-design-tune.md" <<'__USB_SKILL_D0E8F2021648957A__'
---
description: "[MCP Tool Design & Best Practices] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets MCP tool descriptor / resource definition / prompt template / server metadata."
slug: mcp-tool-design-tune
name: MCP Tool Design & Best Practices: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:mcp-tool-design, workflow:tune, optimization, mcp, tools, agents
---

# MCP Tool Design & Best Practices: Tune

[MCP Tool Design & Best Practices] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..

## When to use it
Optimize "MCP Tool Design & Best Practices". Target the failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent." or the typical verification command mcp-cli run + mcp inspector + tool name conflict analysis. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising MCP Tool Design & Best Practices. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is MCP tool descriptor / resource definition / prompt template / server metadata. Measure using mcp-cli run + mcp inspector + tool name conflict analysis. Guard against: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise MCP Tool Design & Best Practices" — benchmark mcp-cli run before and after.
- "Tune MCP tool descriptor / resource definition / prompt template / server metadata performance" — reduce cost/latency while monitoring Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.
__USB_SKILL_D0E8F2021648957A__

write_file "$PACK_DIR/skills/message-queues-tune.md" <<'__USB_SKILL_469D2B64836E6083__'
---
description: "[Message Queues & Background Jobs] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets queue producer / worker / dead-letter handler / retry policy."
slug: message-queues-tune
name: Message Queues & Background Jobs: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:message-queues, workflow:tune, optimization, queue, background-jobs, backend
---

# Message Queues & Background Jobs: Tune

[Message Queues & Background Jobs] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..

## When to use it
Optimize "Message Queues & Background Jobs". Target the failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled." or the typical verification command Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Message Queues & Background Jobs. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is queue producer / worker / dead-letter handler / retry policy. Measure using Bull/BullMQ dashboard + job retry count monitoring + dead-letter inspection. Guard against: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific queue producer / worker / dead-letter handler / retry policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Message Queues & Background Jobs" — benchmark Bull/BullMQ dashboard before and after.
- "Tune queue producer / worker / dead-letter handler / retry policy performance" — reduce cost/latency while monitoring Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.
__USB_SKILL_469D2B64836E6083__

write_file "$PACK_DIR/skills/multi-tenant-isolation-tune.md" <<'__USB_SKILL_984E22BE8E8367A3__'
---
description: "[Multi-Tenant Data Isolation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder."
slug: multi-tenant-isolation-tune
name: Multi-Tenant Data Isolation: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:multi-tenant-isolation, workflow:tune, optimization, multi-tenant, saas, database
---

# Multi-Tenant Data Isolation: Tune

[Multi-Tenant Data Isolation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..

## When to use it
Optimize "Multi-Tenant Data Isolation". Target the failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data." or the typical verification command RLS policy test with two different tenant sessions + data leakage check. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Multi-Tenant Data Isolation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Measure using RLS policy test with two different tenant sessions + data leakage check. Guard against: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Multi-Tenant Data Isolation" — benchmark RLS policy test with two different tenant sessions before and after.
- "Tune RLS policy / tenant context middleware / session variable injection / tenant-aware query builder performance" — reduce cost/latency while monitoring Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.
__USB_SKILL_984E22BE8E8367A3__

write_file "$PACK_DIR/skills/nextjs-api-routes-tune.md" <<'__USB_SKILL_EF6C1C81ACD80AC8__'
---
description: "[Next.js API Routes & Route Handlers] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets route.ts handler / server action / API client wrapper / error boundary."
slug: nextjs-api-routes-tune
name: Next.js API Routes & Route Handlers: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-api-routes, workflow:tune, optimization, nextjs, api, backend
---

# Next.js API Routes & Route Handlers: Tune

[Next.js API Routes & Route Handlers] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..

## When to use it
Optimize "Next.js API Routes & Route Handlers". Target the failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component." or the typical verification command curl --verbose + API route error log + status code audit. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Next.js API Routes & Route Handlers. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is route.ts handler / server action / API client wrapper / error boundary. Measure using curl --verbose + API route error log + status code audit. Guard against: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific route.ts handler / server action / API client wrapper / error boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Next.js API Routes & Route Handlers" — benchmark curl --verbose before and after.
- "Tune route.ts handler / server action / API client wrapper / error boundary performance" — reduce cost/latency while monitoring Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.
__USB_SKILL_EF6C1C81ACD80AC8__

write_file "$PACK_DIR/skills/nextjs-data-fetching-tune.md" <<'__USB_SKILL_817E2F71BD0248AB__'
---
description: "[Next.js Data Fetching Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets server fetch / React cache wrapper / streaming suspense boundary."
slug: nextjs-data-fetching-tune
name: Next.js Data Fetching Patterns: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-data-fetching, workflow:tune, optimization, nextjs, data-fetching, fullstack
---

# Next.js Data Fetching Patterns: Tune

[Next.js Data Fetching Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..

## When to use it
Optimize "Next.js Data Fetching Patterns". Target the failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests." or the typical verification command next build --debug + React DevTools fetch profiling. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Next.js Data Fetching Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is server fetch / React cache wrapper / streaming suspense boundary. Measure using next build --debug + React DevTools fetch profiling. Guard against: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server fetch / React cache wrapper / streaming suspense boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Next.js Data Fetching Patterns" — benchmark next build --debug before and after.
- "Tune server fetch / React cache wrapper / streaming suspense boundary performance" — reduce cost/latency while monitoring Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.
__USB_SKILL_817E2F71BD0248AB__

write_file "$PACK_DIR/skills/nextjs-middleware-tune.md" <<'__USB_SKILL_59FA02EE890F2F12__'
---
description: "[Next.js Middleware & Edge Runtime] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing."
slug: nextjs-middleware-tune
name: Next.js Middleware & Edge Runtime: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-middleware, workflow:tune, optimization, nextjs, middleware, edge
---

# Next.js Middleware & Edge Runtime: Tune

[Next.js Middleware & Edge Runtime] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..

## When to use it
Optimize "Next.js Middleware & Edge Runtime". Target the failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes." or the typical verification command next dev + curl --cookie tests + edge runtime log inspection. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Next.js Middleware & Edge Runtime. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Measure using next dev + curl --cookie tests + edge runtime log inspection. Guard against: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Next.js Middleware & Edge Runtime" — benchmark next dev before and after.
- "Tune middleware.ts / rewrite rule / cookie-based redirect / geolocation routing performance" — reduce cost/latency while monitoring Using Node.
__USB_SKILL_59FA02EE890F2F12__

write_file "$PACK_DIR/skills/node-error-handling-tune.md" <<'__USB_SKILL_CC7D4CD85C9E42BC__'
---
description: "[Node.js Error Handling & Resilience] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets global error handler / async wrapper / structured error response / retry logic."
slug: node-error-handling-tune
name: Node.js Error Handling & Resilience: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:node-error-handling, workflow:tune, optimization, node, error-handling, backend
---

# Node.js Error Handling & Resilience: Tune

[Node.js Error Handling & Resilience] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..

## When to use it
Optimize "Node.js Error Handling & Resilience". Target the failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context." or the typical verification command node --unhandled-rejections=strict + process.on('uncaughtException') log. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Node.js Error Handling & Resilience. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is global error handler / async wrapper / structured error response / retry logic. Measure using node --unhandled-rejections=strict + process.on('uncaughtException') log. Guard against: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific global error handler / async wrapper / structured error response / retry logic this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Node.js Error Handling & Resilience" — benchmark node --unhandled-rejections=strict before and after.
- "Tune global error handler / async wrapper / structured error response / retry logic performance" — reduce cost/latency while monitoring Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.
__USB_SKILL_CC7D4CD85C9E42BC__

write_file "$PACK_DIR/skills/node-streams-tune.md" <<'__USB_SKILL_31621A731A7E3065__'
---
description: "[Node.js Streams & Backpressure] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Readable/Writable stream / Transform / pipeline() refactor."
slug: node-streams-tune
name: Node.js Streams & Backpressure: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:node-streams, workflow:tune, optimization, node, streams, performance
---

# Node.js Streams & Backpressure: Tune

[Node.js Streams & Backpressure] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..

## When to use it
Optimize "Node.js Streams & Backpressure". Target the failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams." or the typical verification command Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Node.js Streams & Backpressure. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is Readable/Writable stream / Transform / pipeline() refactor. Measure using Node.js --inspect memory heap snapshot + stream highWaterMark tuning. Guard against: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Readable/Writable stream / Transform / pipeline() refactor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Node.js Streams & Backpressure" — benchmark Node.js --inspect memory heap snapshot before and after.
- "Tune Readable/Writable stream / Transform / pipeline() refactor performance" — reduce cost/latency while monitoring Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.
__USB_SKILL_31621A731A7E3065__

write_file "$PACK_DIR/skills/oauth-flows-tune.md" <<'__USB_SKILL_608CC6C55013F2A3__'
---
description: "[OAuth 2.0 Flows & Token Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler."
slug: oauth-flows-tune
name: OAuth 2.0 Flows & Token Management: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:oauth-flows, workflow:tune, optimization, oauth, auth, security
---

# OAuth 2.0 Flows & Token Management: Tune

[OAuth 2.0 Flows & Token Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..

## When to use it
Optimize "OAuth 2.0 Flows & Token Management". Target the failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation." or the typical verification command oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising OAuth 2.0 Flows & Token Management. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Measure using oauth2_proxy + jwt.io debugger + curl --cookie with token inspection. Guard against: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise OAuth 2.0 Flows & Token Management" — benchmark oauth2_proxy before and after.
- "Tune OAuth callback / token refresh / PKCE flow / httpOnly cookie handler performance" — reduce cost/latency while monitoring Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.
__USB_SKILL_608CC6C55013F2A3__

write_file "$PACK_DIR/skills/openapi-spec-tune.md" <<'__USB_SKILL_9ECA40EF31F9EE56__'
---
description: "[OpenAPI Specification & Validation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets openapi.yaml / code-first generator / request/response validation middleware."
slug: openapi-spec-tune
name: OpenAPI Specification & Validation: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:openapi-spec, workflow:tune, optimization, openapi, api, contract
---

# OpenAPI Specification & Validation: Tune

[OpenAPI Specification & Validation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..

## When to use it
Optimize "OpenAPI Specification & Validation". Target the failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code." or the typical verification command redocly lint + openapi-diff + swagger-ui preview. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising OpenAPI Specification & Validation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is openapi.yaml / code-first generator / request/response validation middleware. Measure using redocly lint + openapi-diff + swagger-ui preview. Guard against: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific openapi.yaml / code-first generator / request/response validation middleware this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise OpenAPI Specification & Validation" — benchmark redocly lint before and after.
- "Tune openapi.yaml / code-first generator / request/response validation middleware performance" — reduce cost/latency while monitoring Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.
__USB_SKILL_9ECA40EF31F9EE56__

write_file "$PACK_DIR/skills/playwright-selectors-tune.md" <<'__USB_SKILL_1E1374DABE8ECE86__'
---
description: "[Playwright Selectors & Locators] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture."
slug: playwright-selectors-tune
name: Playwright Selectors & Locators: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:playwright-selectors, workflow:tune, optimization, playwright, testing, e2e
---

# Playwright Selectors & Locators: Tune

[Playwright Selectors & Locators] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..

## When to use it
Optimize "Playwright Selectors & Locators". Target the failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update." or the typical verification command playwright test --reporter=html + playwright codegen + trace viewer. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Playwright Selectors & Locators. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Measure using playwright test --reporter=html + playwright codegen + trace viewer. Guard against: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Playwright Selectors & Locators" — benchmark playwright test --reporter=html before and after.
- "Tune locator refactor / test fixture / POM (Page Object Model) / custom fixture performance" — reduce cost/latency while monitoring Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.
__USB_SKILL_1E1374DABE8ECE86__

write_file "$PACK_DIR/skills/prompt-injection-defense-tune.md" <<'__USB_SKILL_F0C24C4CCDFEA081__'
---
description: "[Prompt Injection Defense] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator."
slug: prompt-injection-defense-tune
name: Prompt Injection Defense: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:prompt-injection-defense, workflow:tune, optimization, prompt, security, llm
---

# Prompt Injection Defense: Tune

[Prompt Injection Defense] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..

## When to use it
Optimize "Prompt Injection Defense". Target the failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'." or the typical verification command prompt injection test suite + adversarial input fuzzing + output scanner. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Prompt Injection Defense. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is defensive system prompt / input sanitizer / instruction guardrail / output validator. Measure using prompt injection test suite + adversarial input fuzzing + output scanner. Guard against: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Prompt Injection Defense" — benchmark prompt injection test suite before and after.
- "Tune defensive system prompt / input sanitizer / instruction guardrail / output validator performance" — reduce cost/latency while monitoring Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.
__USB_SKILL_F0C24C4CCDFEA081__

write_file "$PACK_DIR/skills/python-async-tune.md" <<'__USB_SKILL_6C354AFE60C32C9B__'
---
description: "[Python Async/Await Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets async/await refactor / asyncio.gather / async context manager."
slug: python-async-tune
name: Python Async/Await Patterns: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:python-async, workflow:tune, optimization, python, async, performance
---

# Python Async/Await Patterns: Tune

[Python Async/Await Patterns] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..

## When to use it
Optimize "Python Async/Await Patterns". Target the failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions." or the typical verification command python3 -m asyncio + aiohttp/httpx async benchmark. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Python Async/Await Patterns. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is async/await refactor / asyncio.gather / async context manager. Measure using python3 -m asyncio + aiohttp/httpx async benchmark. Guard against: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific async/await refactor / asyncio.gather / async context manager this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Python Async/Await Patterns" — benchmark python3 -m asyncio before and after.
- "Tune async/await refactor / asyncio.gather / async context manager performance" — reduce cost/latency while monitoring Blocking the event loop by using synchronous requests or time.
__USB_SKILL_6C354AFE60C32C9B__

write_file "$PACK_DIR/skills/python-file-io-tune.md" <<'__USB_SKILL_697666E1FD3209D8__'
---
description: "[Python File I/O & Encoding] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets pathlib refactor / encoding-safe file reader / batch file processor."
slug: python-file-io-tune
name: Python File I/O & Encoding: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:python-file-io, workflow:tune, optimization, python, file-io, scripting
---

# Python File I/O & Encoding: Tune

[Python File I/O & Encoding] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..

## When to use it
Optimize "Python File I/O & Encoding". Target the failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content." or the typical verification command python3 -c with open() + chardet encoding detection. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Python File I/O & Encoding. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is pathlib refactor / encoding-safe file reader / batch file processor. Measure using python3 -c with open() + chardet encoding detection. Guard against: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Python File I/O & Encoding" — benchmark python3 -c with open() before and after.
- "Tune pathlib refactor / encoding-safe file reader / batch file processor performance" — reduce cost/latency while monitoring Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.
__USB_SKILL_697666E1FD3209D8__

write_file "$PACK_DIR/skills/rag-chunking-tune.md" <<'__USB_SKILL_0CB09926DB827BD9__'
---
description: "[RAG Chunking Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment."
slug: rag-chunking-tune
name: RAG Chunking Strategies: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rag-chunking, workflow:tune, optimization, rag, chunking, retrieval
---

# RAG Chunking Strategies: Tune

[RAG Chunking Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..

## When to use it
Optimize "RAG Chunking Strategies". Target the failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality." or the typical verification command retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising RAG Chunking Strategies. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Measure using retrieval evaluation script + chunk boundary visualisation + recall@k measurement. Guard against: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise RAG Chunking Strategies" — benchmark retrieval evaluation script before and after.
- "Tune semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment performance" — reduce cost/latency while monitoring Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.
__USB_SKILL_0CB09926DB827BD9__

write_file "$PACK_DIR/skills/rate-limiting-proxy-tune.md" <<'__USB_SKILL_409CFAC63A4A88FA__'
---
description: "[Rate Limiting & API Gateway Proxy] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation."
slug: rate-limiting-proxy-tune
name: Rate Limiting & API Gateway Proxy: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rate-limiting-proxy, workflow:tune, optimization, rate-limiting, proxy, security
---

# Rate Limiting & API Gateway Proxy: Tune

[Rate Limiting & API Gateway Proxy] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..

## When to use it
Optimize "Rate Limiting & API Gateway Proxy". Target the failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources." or the typical verification command ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Rate Limiting & API Gateway Proxy. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Measure using ab -n 1000 -c 10 + nginx error log + 429 response code monitoring. Guard against: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Rate Limiting & API Gateway Proxy" — benchmark ab -n 1000 -c 10 before and after.
- "Tune NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation performance" — reduce cost/latency while monitoring Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.
__USB_SKILL_409CFAC63A4A88FA__

write_file "$PACK_DIR/skills/react-server-components-tune.md" <<'__USB_SKILL_9073F2BBF58EE0D1__'
---
description: "[React Server Components] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets server component / client boundary refactor / streaming fallback."
slug: react-server-components-tune
name: React Server Components: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:react-server-components, workflow:tune, optimization, react, rsc, frontend
---

# React Server Components: Tune

[React Server Components] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..

## When to use it
Optimize "React Server Components". Target the failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file." or the typical verification command next build --debug + React Server Components lint rule. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising React Server Components. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is server component / client boundary refactor / streaming fallback. Measure using next build --debug + React Server Components lint rule. Guard against: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server component / client boundary refactor / streaming fallback this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise React Server Components" — benchmark next build --debug before and after.
- "Tune server component / client boundary refactor / streaming fallback performance" — reduce cost/latency while monitoring Accidentally making a server component a client component by using hooks or event handlers in the wrong file.
__USB_SKILL_9073F2BBF58EE0D1__

write_file "$PACK_DIR/skills/react-state-tune.md" <<'__USB_SKILL_31E525CC62782206__'
---
description: "[React State Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice."
slug: react-state-tune
name: React State Management: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:react-state, workflow:tune, optimization, react, state, frontend
---

# React State Management: Tune

[React State Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..

## When to use it
Optimize "React State Management". Target the failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation." or the typical verification command React DevTools profiler + why-did-you-render. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising React State Management. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Measure using React DevTools profiler + why-did-you-render. Guard against: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise React State Management" — benchmark React DevTools profiler before and after.
- "Tune useState / useReducer / useContext hook refactor, zustand or jotai store slice performance" — reduce cost/latency while monitoring Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.
__USB_SKILL_31E525CC62782206__

write_file "$PACK_DIR/skills/redis-caching-tune.md" <<'__USB_SKILL_47D5A1D49FAAAF02__'
---
description: "[Redis Caching Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy."
slug: redis-caching-tune
name: Redis Caching Strategies: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:redis-caching, workflow:tune, optimization, redis, caching, performance
---

# Redis Caching Strategies: Tune

[Redis Caching Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..

## When to use it
Optimize "Redis Caching Strategies". Target the failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time." or the typical verification command redis-cli --stat + cache hit ratio monitoring + slow log. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Redis Caching Strategies. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Measure using redis-cli --stat + cache hit ratio monitoring + slow log. Guard against: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Redis Caching Strategies" — benchmark redis-cli --stat before and after.
- "Tune cache wrapper / mutex lock / stale-while-revalidate / TTL policy performance" — reduce cost/latency while monitoring Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.
__USB_SKILL_47D5A1D49FAAAF02__

write_file "$PACK_DIR/skills/rest-pagination-tune.md" <<'__USB_SKILL_EF4F091E97BBEB0A__'
---
description: "[REST Pagination Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope."
slug: rest-pagination-tune
name: REST Pagination Design: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:rest-pagination, workflow:tune, optimization, rest, pagination, api
---

# REST Pagination Design: Tune

[REST Pagination Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..

## When to use it
Optimize "REST Pagination Design". Target the failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows." or the typical verification command curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising REST Pagination Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Measure using curl with cursor param + SQL EXPLAIN for offset vs keyset + performance benchmark. Guard against: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise REST Pagination Design" — benchmark curl with cursor param before and after.
- "Tune cursor pagination / offset pagination fallback / total count optimisation / response envelope performance" — reduce cost/latency while monitoring Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.
__USB_SKILL_EF4F091E97BBEB0A__

write_file "$PACK_DIR/skills/secrets-rotation-tune.md" <<'__USB_SKILL_FB35E81511AEC5D5__'
---
description: "[Secrets Rotation Policy] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets rotation script / vault integration / lease management / incident response plan."
slug: secrets-rotation-tune
name: Secrets Rotation Policy: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:secrets-rotation, workflow:tune, optimization, secrets, security, rotation
---

# Secrets Rotation Policy: Tune

[Secrets Rotation Policy] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..

## When to use it
Optimize "Secrets Rotation Policy". Target the failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak." or the typical verification command vault lease list + secret expiry check + rotation dry-run test. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Secrets Rotation Policy. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is rotation script / vault integration / lease management / incident response plan. Measure using vault lease list + secret expiry check + rotation dry-run test. Guard against: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific rotation script / vault integration / lease management / incident response plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Secrets Rotation Policy" — benchmark vault lease list before and after.
- "Tune rotation script / vault integration / lease management / incident response plan performance" — reduce cost/latency while monitoring Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.
__USB_SKILL_FB35E81511AEC5D5__

write_file "$PACK_DIR/skills/shell-script-robustness-tune.md" <<'__USB_SKILL_F2C1F2B0857C1EA4__'
---
description: "[Shell Script Robustness & Safety] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function."
slug: shell-script-robustness-tune
name: Shell Script Robustness & Safety: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:shell-script-robustness, workflow:tune, optimization, shell, scripting, safety
---

# Shell Script Robustness & Safety: Tune

[Shell Script Robustness & Safety] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..

## When to use it
Optimize "Shell Script Robustness & Safety". Target the failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage." or the typical verification command shellcheck script.sh + bash -n script.sh + dry-run mode test. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Shell Script Robustness & Safety. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Measure using shellcheck script.sh + bash -n script.sh + dry-run mode test. Guard against: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Shell Script Robustness & Safety" — benchmark shellcheck script.sh before and after.
- "Tune set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function performance" — reduce cost/latency while monitoring Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.
__USB_SKILL_F2C1F2B0857C1EA4__

write_file "$PACK_DIR/skills/sql-query-optimization-tune.md" <<'__USB_SKILL_2B07BA2A1FBFB620__'
---
description: "[SQL Query Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index."
slug: sql-query-optimization-tune
name: SQL Query Optimisation: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:sql-query-optimization, workflow:tune, optimization, sql, database
---

# SQL Query Optimisation: Tune

[SQL Query Optimisation] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..

## When to use it
Optimize "SQL Query Optimisation". Target the failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs." or the typical verification command EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising SQL Query Optimisation. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Measure using EXPLAIN (ANALYSE, BUFFERS) + pg_stat_user_indexes + missing index query. Guard against: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise SQL Query Optimisation" — benchmark EXPLAIN (ANALYSE, BUFFERS) before and after.
- "Tune indexed query / composite index / EXPLAIN ANALYSE plan / partial index performance" — reduce cost/latency while monitoring Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.
__USB_SKILL_2B07BA2A1FBFB620__

write_file "$PACK_DIR/skills/stealth-web-research-tune.md" <<'__USB_SKILL_9C4C477E755B1F1F__'
---
description: "[Stealth Web Research & Harvesting] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages."
slug: stealth-web-research-tune
name: Stealth Web Research & Harvesting: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:stealth-web-research, workflow:tune, optimization, stealth, scraping, research, anti-bot
---

# Stealth Web Research & Harvesting: Tune

[Stealth Web Research & Harvesting] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..

## When to use it
Optimize "Stealth Web Research & Harvesting". Target the failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests." or the typical verification command playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Stealth Web Research & Harvesting. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Measure using playwright-extra + stealth + cheerio + defuddle + manual jq inspection. Guard against: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Stealth Web Research & Harvesting" — benchmark playwright-extra before and after.
- "Tune clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages performance" — reduce cost/latency while monitoring Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.
__USB_SKILL_9C4C477E755B1F1F__

write_file "$PACK_DIR/skills/stripe-webhook-idempotency-tune.md" <<'__USB_SKILL_B997360CAAB03769__'
---
description: "[Stripe Webhook Idempotency] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery."
slug: stripe-webhook-idempotency-tune
name: Stripe Webhook Idempotency: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:stripe-webhook-idempotency, workflow:tune, optimization, stripe, webhook, payments
---

# Stripe Webhook Idempotency: Tune

[Stripe Webhook Idempotency] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..

## When to use it
Optimize "Stripe Webhook Idempotency". Target the failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations." or the typical verification command stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Stripe Webhook Idempotency. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Measure using stripe trigger payment_intent.succeeded + stripe logs tail + database dedup check. Guard against: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Stripe Webhook Idempotency" — benchmark stripe trigger payment_intent.succeeded before and after.
- "Tune Webhook handler / idempotency key check / event deduplication / failed payment recovery performance" — reduce cost/latency while monitoring Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.
__USB_SKILL_B997360CAAB03769__

write_file "$PACK_DIR/skills/supabase-rls-tune.md" <<'__USB_SKILL_E54161C28AA9190B__'
---
description: "[Supabase Row-Level Security] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets RLS policy / policy test / security definer function / admin bypass."
slug: supabase-rls-tune
name: Supabase Row-Level Security: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:supabase-rls, workflow:tune, optimization, supabase, rls, security
---

# Supabase Row-Level Security: Tune

[Supabase Row-Level Security] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..

## When to use it
Optimize "Supabase Row-Level Security". Target the failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data." or the typical verification command supabase db check + supabase db test + RLS policy review with pg_policies. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Supabase Row-Level Security. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is RLS policy / policy test / security definer function / admin bypass. Measure using supabase db check + supabase db test + RLS policy review with pg_policies. Guard against: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / policy test / security definer function / admin bypass this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Supabase Row-Level Security" — benchmark supabase db check before and after.
- "Tune RLS policy / policy test / security definer function / admin bypass performance" — reduce cost/latency while monitoring RLS policies that are too permissive (using 'true' instead of 'auth.
__USB_SKILL_E54161C28AA9190B__

write_file "$PACK_DIR/skills/terraform-state-tune.md" <<'__USB_SKILL_32FE12A9CDFD6925__'
---
description: "[Terraform State Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets backend config / state migration plan / state locking config / remote state datasource."
slug: terraform-state-tune
name: Terraform State Management: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:terraform-state, workflow:tune, optimization, terraform, state, iac
---

# Terraform State Management: Tune

[Terraform State Management] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..

## When to use it
Optimize "Terraform State Management". Target the failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure." or the typical verification command terraform plan + terraform state list + terraform state pull | jq. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Terraform State Management. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is backend config / state migration plan / state locking config / remote state datasource. Measure using terraform plan + terraform state list + terraform state pull | jq. Guard against: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific backend config / state migration plan / state locking config / remote state datasource this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Terraform State Management" — benchmark terraform plan before and after.
- "Tune backend config / state migration plan / state locking config / remote state datasource performance" — reduce cost/latency while monitoring Losing the .
__USB_SKILL_32FE12A9CDFD6925__

write_file "$PACK_DIR/skills/typescript-generics-tune.md" <<'__USB_SKILL_8B8F537D938E6602__'
---
description: "[TypeScript Generics & Advanced Types] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets generic type / conditional type / mapped type / branded type."
slug: typescript-generics-tune
name: TypeScript Generics & Advanced Types: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:typescript-generics, workflow:tune, optimization, typescript, generics, type-system
---

# TypeScript Generics & Advanced Types: Tune

[TypeScript Generics & Advanced Types] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..

## When to use it
Optimize "TypeScript Generics & Advanced Types". Target the failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)." or the typical verification command tsc --noEmit --strict + type tests with expect-type. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising TypeScript Generics & Advanced Types. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is generic type / conditional type / mapped type / branded type. Measure using tsc --noEmit --strict + type tests with expect-type. Guard against: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific generic type / conditional type / mapped type / branded type this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise TypeScript Generics & Advanced Types" — benchmark tsc --noEmit --strict before and after.
- "Tune generic type / conditional type / mapped type / branded type performance" — reduce cost/latency while monitoring Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).
__USB_SKILL_8B8F537D938E6602__

write_file "$PACK_DIR/skills/user-onboarding-flow-tune.md" <<'__USB_SKILL_DC1267648599B225__'
---
description: "[User Onboarding Flow Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec."
slug: user-onboarding-flow-tune
name: User Onboarding Flow Design: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:user-onboarding-flow, workflow:tune, optimization, ux, onboarding, product
---

# User Onboarding Flow Design: Tune

[User Onboarding Flow Design] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..

## When to use it
Optimize "User Onboarding Flow Design". Target the failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value." or the typical verification command analytics funnel analysis + onboarding completion rate + drop-off heatmap. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising User Onboarding Flow Design. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Measure using analytics funnel analysis + onboarding completion rate + drop-off heatmap. Guard against: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise User Onboarding Flow Design" — benchmark analytics funnel analysis before and after.
- "Tune onboarding wizard / feature checklist / in-app guide / first-run experience spec performance" — reduce cost/latency while monitoring Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.
__USB_SKILL_DC1267648599B225__

write_file "$PACK_DIR/skills/vercel-env-vars-tune.md" <<'__USB_SKILL_E18E0F8524574A73__'
---
description: "[Vercel Environment Variables] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets vercel.json env group / preview env config / Edge Config / KV store."
slug: vercel-env-vars-tune
name: Vercel Environment Variables: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:vercel-env-vars, workflow:tune, optimization, vercel, env, deployment
---

# Vercel Environment Variables: Tune

[Vercel Environment Variables] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..

## When to use it
Optimize "Vercel Environment Variables". Target the failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments." or the typical verification command vercel env pull + vercel list + project settings audit. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Vercel Environment Variables. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is vercel.json env group / preview env config / Edge Config / KV store. Measure using vercel env pull + vercel list + project settings audit. Guard against: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific vercel.json env group / preview env config / Edge Config / KV store this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Vercel Environment Variables" — benchmark vercel env pull before and after.
- "Tune vercel.json env group / preview env config / Edge Config / KV store performance" — reduce cost/latency while monitoring Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.
__USB_SKILL_E18E0F8524574A73__

write_file "$PACK_DIR/skills/web-scraping-ethics-tune.md" <<'__USB_SKILL_C5E1021E6F72291E__'
---
description: "[Web Scraping Ethics & Compliance] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper."
slug: web-scraping-ethics-tune
name: Web Scraping Ethics & Compliance: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:web-scraping-ethics, workflow:tune, optimization, scraping, ethics, research
---

# Web Scraping Ethics & Compliance: Tune

[Web Scraping Ethics & Compliance] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..

## When to use it
Optimize "Web Scraping Ethics & Compliance". Target the failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues." or the typical verification command curl robots.txt + wget --wait + scraper log audit. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Web Scraping Ethics & Compliance. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Measure using curl robots.txt + wget --wait + scraper log audit. Guard against: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Web Scraping Ethics & Compliance" — benchmark curl robots.txt before and after.
- "Tune robots.txt check / polite scraper / rate-limited crawler / cached scraper performance" — reduce cost/latency while monitoring Scraping a website that explicitly prohibits it in robots.
__USB_SKILL_C5E1021E6F72291E__

write_file "$PACK_DIR/skills/websocket-reconnection-tune.md" <<'__USB_SKILL_C0D2586E9B0A2A53__'
---
description: "[WebSocket Reconnection Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets WebSocket client / reconnection logic / heartbeat / connection status component."
slug: websocket-reconnection-tune
name: WebSocket Reconnection Strategies: Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:websocket-reconnection, workflow:tune, optimization, websocket, realtime, frontend
---

# WebSocket Reconnection Strategies: Tune

[WebSocket Reconnection Strategies] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..

## When to use it
Optimize "WebSocket Reconnection Strategies". Target the failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state." or the typical verification command Browser DevTools Network tab WS filter + reconnection test with server restart. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising WebSocket Reconnection Strategies. Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is WebSocket client / reconnection logic / heartbeat / connection status component. Measure using Browser DevTools Network tab WS filter + reconnection test with server restart. Guard against: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise WebSocket Reconnection Strategies" — benchmark Browser DevTools Network tab WS filter before and after.
- "Tune WebSocket client / reconnection logic / heartbeat / connection status component performance" — reduce cost/latency while monitoring Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.
__USB_SKILL_C0D2586E9B0A2A53__

write_file "$PACK_DIR/skills/web-vitals-optimization-tune.md" <<'__USB_SKILL_0AF3A4E48926DD89__'
---
description: "[Web Vitals Optimisation (LCP/CLS/INP)] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis."
slug: web-vitals-optimization-tune
name: Web Vitals Optimisation (LCP/CLS/INP): Tune
category: Optimization
risk: medium
model_agnostic: true
agent_agnostic: true
tags: target:web-vitals-optimization, workflow:tune, optimization, performance, web-vitals, optimisation
---

# Web Vitals Optimisation (LCP/CLS/INP): Tune

[Web Vitals Optimisation (LCP/CLS/INP)] Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..

## When to use it
Optimize "Web Vitals Optimisation (LCP/CLS/INP)". Target the failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)." or the typical verification command Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Benchmark before and after. Prefer non-breaking optimisations.

## Protocol
You are optimising Web Vitals Optimisation (LCP/CLS/INP). Improve a measurable metric: execution time, memory usage, token consumption, cost, or user-perceived latency. Benchmark before and after. Prefer non-breaking changes. If a breaking change is needed, provide a migration path.. The target is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Measure using Lighthouse CI + WebPageTest filmstrip + Core Web Vitals Chrome extension. Guard against: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Report before/after values.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Optimise Web Vitals Optimisation (LCP/CLS/INP)" — benchmark Lighthouse CI before and after.
- "Tune image optimisation / font display swap / critical CSS / lazy load / bundle analysis performance" — reduce cost/latency while monitoring Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).
__USB_SKILL_0AF3A4E48926DD89__

write_file "$PACK_DIR/skills/intent-router.md" <<'__USB_SKILL_45BCA16379F69095__'
---
description: "Analyses a user request, determines the most appropriate skill to invoke, and produces a ranked execution plan. Prevents unnecessary agent context switching by grouping related sub-tasks under a single skill. Call this when a user request is vague, multi-layered, or when you are unsure which specialised skill applies."
slug: intent-router
name: Intent Router
category: Orchestration
risk: low
model_agnostic: true
agent_agnostic: true
tags: router, orchestration, classification
---

# Intent Router

Analyses a user request, determines the most appropriate skill to invoke, and produces a ranked execution plan. Prevents unnecessary agent context switching by grouping related sub-tasks under a single skill.

## When to use it
Call this when a user request is vague, multi-layered, or when you are unsure which specialised skill applies.

## Protocol
Read the full request. Identify the primary intent (create, debug, refactor, document, secure, optimise). Determine the target layer (frontend, backend, data, infra, AI, docs). Choose the single best matching skill slug. Explain the choice in one sentence. If multiple skills could apply, rank them and output a sequence. Never default to asking clarifying questions if a safe fallback exists.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- User asks 'set up authentication for my app' → route to oauth-auth-guardian.
- User says 'the build is failing' → route to incident-debugger.
__USB_SKILL_45BCA16379F69095__

write_file "$PACK_DIR/skills/a-b-testing-framework-plan.md" <<'__USB_SKILL_8543C34E9032F3FB__'
---
description: "[A/B Testing Framework] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets experiment spec / variant assignment / metric definition / statistical analysis script."
slug: a-b-testing-framework-plan
name: A/B Testing Framework: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:a-b-testing-framework, workflow:plan, planning, ab-testing, experiments, product
---

# A/B Testing Framework: Plan

[A/B Testing Framework] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..

## When to use it
A change to "A/B Testing Framework" needs to be designed first. Consider the common failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise." and the best practice "Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.". Produce a plan before writing any code.

## Protocol
You are designing a plan for A/B Testing Framework. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. The output artifact is experiment spec / variant assignment / metric definition / statistical analysis script. Consider the failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the A/B Testing Framework feature" — produce a step-by-step implementation sequence with experiment spec / variant assignment / metric definition / statistical analysis script as the target.
- "Design A/B Testing Framework changes" — document trade-offs, addressing Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.
__USB_SKILL_8543C34E9032F3FB__

write_file "$PACK_DIR/skills/a11y-aria-patterns-plan.md" <<'__USB_SKILL_1C903904CD08FD09__'
---
description: "[Accessibility ARIA Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script."
slug: a11y-aria-patterns-plan
name: Accessibility ARIA Patterns: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:a11y-aria-patterns, workflow:plan, planning, accessibility, aria, testing
---

# Accessibility ARIA Patterns: Plan

[Accessibility ARIA Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..

## When to use it
A change to "Accessibility ARIA Patterns" needs to be designed first. Consider the common failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers." and the best practice "Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Accessibility ARIA Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. The output artifact is ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Consider the failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Accessibility ARIA Patterns feature" — produce a step-by-step implementation sequence with ARIA attribute refactor / keyboard navigation / focus management / screen reader test script as the target.
- "Design Accessibility ARIA Patterns changes" — document trade-offs, addressing Adding ARIA attributes that conflict with native HTML semantics (e.
__USB_SKILL_1C903904CD08FD09__

write_file "$PACK_DIR/skills/agent-tool-binding-plan.md" <<'__USB_SKILL_6753252F7C54BDE1__'
---
description: "[Agent Tool Binding & Dispatch] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets router tool / domain group / dynamic tool injection / tool usage statistics."
slug: agent-tool-binding-plan
name: Agent Tool Binding & Dispatch: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:agent-tool-binding, workflow:plan, planning, agents, tool-binding, orchestration
---

# Agent Tool Binding & Dispatch: Plan

[Agent Tool Binding & Dispatch] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..

## When to use it
A change to "Agent Tool Binding & Dispatch" needs to be designed first. Consider the common failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly." and the best practice "Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Agent Tool Binding & Dispatch. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. The output artifact is router tool / domain group / dynamic tool injection / tool usage statistics. Consider the failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Agent Tool Binding & Dispatch feature" — produce a step-by-step implementation sequence with router tool / domain group / dynamic tool injection / tool usage statistics as the target.
- "Design Agent Tool Binding & Dispatch changes" — document trade-offs, addressing Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.
__USB_SKILL_6753252F7C54BDE1__

write_file "$PACK_DIR/skills/analytics-metric-definition-plan.md" <<'__USB_SKILL_E63B8678C7DE96F9__'
---
description: "[Analytics Metric Definitions] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation."
slug: analytics-metric-definition-plan
name: Analytics Metric Definitions: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:analytics-metric-definition, workflow:plan, planning, analytics, metrics, data
---

# Analytics Metric Definitions: Plan

[Analytics Metric Definitions] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..

## When to use it
A change to "Analytics Metric Definitions" needs to be designed first. Consider the common failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers." and the best practice "Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Analytics Metric Definitions. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. The output artifact is metric definition / dbt model / SQL logic / dashboard tile / documentation. Consider the failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Analytics Metric Definitions feature" — produce a step-by-step implementation sequence with metric definition / dbt model / SQL logic / dashboard tile / documentation as the target.
- "Design Analytics Metric Definitions changes" — document trade-offs, addressing Different teams computing the same metric (e.
__USB_SKILL_E63B8678C7DE96F9__

write_file "$PACK_DIR/skills/adr-documentation-plan.md" <<'__USB_SKILL_5EB8A90E7AB463C0__'
---
description: "[Architecture Decision Records] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets ADR document / decision log / template / review workflow."
slug: adr-documentation-plan
name: Architecture Decision Records: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:adr-documentation, workflow:plan, planning, documentation, adr, architecture
---

# Architecture Decision Records: Plan

[Architecture Decision Records] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..

## When to use it
A change to "Architecture Decision Records" needs to be designed first. Consider the common failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done." and the best practice "Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Architecture Decision Records. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. The output artifact is ADR document / decision log / template / review workflow. Consider the failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ADR document / decision log / template / review workflow this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Architecture Decision Records feature" — produce a step-by-step implementation sequence with ADR document / decision log / template / review workflow as the target.
- "Design Architecture Decision Records changes" — document trade-offs, addressing Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.
__USB_SKILL_5EB8A90E7AB463C0__

write_file "$PACK_DIR/skills/aws-lambda-cold-start-plan.md" <<'__USB_SKILL_8532E53FC47D0D05__'
---
description: "[AWS Lambda Cold Starts] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function."
slug: aws-lambda-cold-start-plan
name: AWS Lambda Cold Starts: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:aws-lambda-cold-start, workflow:plan, planning, aws, lambda, performance
---

# AWS Lambda Cold Starts: Plan

[AWS Lambda Cold Starts] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..

## When to use it
A change to "AWS Lambda Cold Starts" needs to be designed first. Consider the common failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler." and the best practice "Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.". Produce a plan before writing any code.

## Protocol
You are designing a plan for AWS Lambda Cold Starts. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. The output artifact is handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Consider the failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the AWS Lambda Cold Starts feature" — produce a step-by-step implementation sequence with handler refactor / SnapStart config / Provisioned Concurrency / warmer function as the target.
- "Design AWS Lambda Cold Starts changes" — document trade-offs, addressing Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.
__USB_SKILL_8532E53FC47D0D05__

write_file "$PACK_DIR/skills/azure-bicep-plan.md" <<'__USB_SKILL_8D22ABDE7873680A__'
---
description: "[Azure Bicep Infrastructure] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets main.bicep / module / parameter file / azd template."
slug: azure-bicep-plan
name: Azure Bicep Infrastructure: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:azure-bicep, workflow:plan, planning, azure, bicep, iac
---

# Azure Bicep Infrastructure: Plan

[Azure Bicep Infrastructure] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..

## When to use it
A change to "Azure Bicep Infrastructure" needs to be designed first. Consider the common failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce." and the best practice "Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Azure Bicep Infrastructure. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. The output artifact is main.bicep / module / parameter file / azd template. Consider the failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific main.bicep / module / parameter file / azd template this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Azure Bicep Infrastructure feature" — produce a step-by-step implementation sequence with main.bicep / module / parameter file / azd template as the target.
- "Design Azure Bicep Infrastructure changes" — document trade-offs, addressing Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.
__USB_SKILL_8D22ABDE7873680A__

write_file "$PACK_DIR/skills/browser-devtools-plan.md" <<'__USB_SKILL_AB6E46C28E107E73__'
---
description: "[Browser DevTools & Debugging] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot."
slug: browser-devtools-plan
name: Browser DevTools & Debugging: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:browser-devtools, workflow:plan, planning, browser, debugging, devtools
---

# Browser DevTools & Debugging: Plan

[Browser DevTools & Debugging] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..

## When to use it
A change to "Browser DevTools & Debugging" needs to be designed first. Consider the common failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically." and the best practice "Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Browser DevTools & Debugging. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. The output artifact is debugging workflow / breakpoint guide / performance recording / memory snapshot. Consider the failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Browser DevTools & Debugging feature" — produce a step-by-step implementation sequence with debugging workflow / breakpoint guide / performance recording / memory snapshot as the target.
- "Design Browser DevTools & Debugging changes" — document trade-offs, addressing Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.
__USB_SKILL_AB6E46C28E107E73__

write_file "$PACK_DIR/skills/cli-tool-design-plan.md" <<'__USB_SKILL_DC53DC62D5FE5957__'
---
description: "[CLI Tool Design Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CLI scaffolding / argument parser / exit code handler / --json output mode."
slug: cli-tool-design-plan
name: CLI Tool Design Patterns: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:cli-tool-design, workflow:plan, planning, cli, devtools, scripting
---

# CLI Tool Design Patterns: Plan

[CLI Tool Design Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..

## When to use it
A change to "CLI Tool Design Patterns" needs to be designed first. Consider the common failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with." and the best practice "Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.". Produce a plan before writing any code.

## Protocol
You are designing a plan for CLI Tool Design Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. The output artifact is CLI scaffolding / argument parser / exit code handler / --json output mode. Consider the failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the CLI Tool Design Patterns feature" — produce a step-by-step implementation sequence with CLI scaffolding / argument parser / exit code handler / --json output mode as the target.
- "Design CLI Tool Design Patterns changes" — document trade-offs, addressing Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.
__USB_SKILL_DC53DC62D5FE5957__

write_file "$PACK_DIR/skills/cloud-cost-optimization-plan.md" <<'__USB_SKILL_8FAFE43C2C00868C__'
---
description: "[Cloud Cost Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report."
slug: cloud-cost-optimization-plan
name: Cloud Cost Optimisation: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:cloud-cost-optimization, workflow:plan, planning, cloud, cost, optimization
---

# Cloud Cost Optimisation: Plan

[Cloud Cost Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..

## When to use it
A change to "Cloud Cost Optimisation" needs to be designed first. Consider the common failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours." and the best practice "Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Cloud Cost Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. The output artifact is right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Consider the failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Cloud Cost Optimisation feature" — produce a step-by-step implementation sequence with right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report as the target.
- "Design Cloud Cost Optimisation changes" — document trade-offs, addressing Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.
__USB_SKILL_8FAFE43C2C00868C__

write_file "$PACK_DIR/skills/code-review-checklist-plan.md" <<'__USB_SKILL_7C60FF8681932476__'
---
description: "[Code Review Checklist] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets review checklist / automated review comment / risk classification / diff summary."
slug: code-review-checklist-plan
name: Code Review Checklist: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:code-review-checklist, workflow:plan, planning, code-review, quality, checklist
---

# Code Review Checklist: Plan

[Code Review Checklist] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..

## When to use it
A change to "Code Review Checklist" needs to be designed first. Consider the common failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions." and the best practice "Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Code Review Checklist. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. The output artifact is review checklist / automated review comment / risk classification / diff summary. Consider the failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific review checklist / automated review comment / risk classification / diff summary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Code Review Checklist feature" — produce a step-by-step implementation sequence with review checklist / automated review comment / risk classification / diff summary as the target.
- "Design Code Review Checklist changes" — document trade-offs, addressing Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.
__USB_SKILL_7C60FF8681932476__

write_file "$PACK_DIR/skills/convex-functions-plan.md" <<'__USB_SKILL_A8AB2ACA78F67D4D__'
---
description: "[Convex Functions & Mutations] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets mutation / query / action / component / scheduler job."
slug: convex-functions-plan
name: Convex Functions & Mutations: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:convex-functions, workflow:plan, planning, convex, realtime, backend
---

# Convex Functions & Mutations: Plan

[Convex Functions & Mutations] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..

## When to use it
A change to "Convex Functions & Mutations" needs to be designed first. Consider the common failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients." and the best practice "Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Convex Functions & Mutations. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. The output artifact is mutation / query / action / component / scheduler job. Consider the failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific mutation / query / action / component / scheduler job this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Convex Functions & Mutations feature" — produce a step-by-step implementation sequence with mutation / query / action / component / scheduler job as the target.
- "Design Convex Functions & Mutations changes" — document trade-offs, addressing Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.
__USB_SKILL_A8AB2ACA78F67D4D__

write_file "$PACK_DIR/skills/cron-job-reliability-plan.md" <<'__USB_SKILL_E533BF0D3B088FFA__'
---
description: "[Cron Job & Scheduled Task Reliability] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets crontab entry / log rotation / idempotency guard / failure alert integration."
slug: cron-job-reliability-plan
name: Cron Job & Scheduled Task Reliability: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:cron-job-reliability, workflow:plan, planning, cron, scheduling, reliability
---

# Cron Job & Scheduled Task Reliability: Plan

[Cron Job & Scheduled Task Reliability] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..

## When to use it
A change to "Cron Job & Scheduled Task Reliability" needs to be designed first. Consider the common failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time." and the best practice "Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Cron Job & Scheduled Task Reliability. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. The output artifact is crontab entry / log rotation / idempotency guard / failure alert integration. Consider the failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Cron Job & Scheduled Task Reliability feature" — produce a step-by-step implementation sequence with crontab entry / log rotation / idempotency guard / failure alert integration as the target.
- "Design Cron Job & Scheduled Task Reliability changes" — document trade-offs, addressing Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.
__USB_SKILL_E533BF0D3B088FFA__

write_file "$PACK_DIR/skills/css-layout-plan.md" <<'__USB_SKILL_036F2DACBD848237__'
---
description: "[CSS Layout & Responsiveness] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CSS layout refactor / responsive grid / container query implementation."
slug: css-layout-plan
name: CSS Layout & Responsiveness: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:css-layout, workflow:plan, planning, css, layout, frontend
---

# CSS Layout & Responsiveness: Plan

[CSS Layout & Responsiveness] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..

## When to use it
A change to "CSS Layout & Responsiveness" needs to be designed first. Consider the common failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable." and the best practice "Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.". Produce a plan before writing any code.

## Protocol
You are designing a plan for CSS Layout & Responsiveness. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. The output artifact is CSS layout refactor / responsive grid / container query implementation. Consider the failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSS layout refactor / responsive grid / container query implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the CSS Layout & Responsiveness feature" — produce a step-by-step implementation sequence with CSS layout refactor / responsive grid / container query implementation as the target.
- "Design CSS Layout & Responsiveness changes" — document trade-offs, addressing Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.
__USB_SKILL_036F2DACBD848237__

write_file "$PACK_DIR/skills/csv-data-cleaning-plan.md" <<'__USB_SKILL_B999A4490ECFFF70__'
---
description: "[CSV Data Cleaning Pipeline] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CSV parser / row validator / column type mapper / error report / cleaned output."
slug: csv-data-cleaning-plan
name: CSV Data Cleaning Pipeline: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:csv-data-cleaning, workflow:plan, planning, data, csv, pipeline
---

# CSV Data Cleaning Pipeline: Plan

[CSV Data Cleaning Pipeline] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..

## When to use it
A change to "CSV Data Cleaning Pipeline" needs to be designed first. Consider the common failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines." and the best practice "Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.". Produce a plan before writing any code.

## Protocol
You are designing a plan for CSV Data Cleaning Pipeline. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. The output artifact is CSV parser / row validator / column type mapper / error report / cleaned output. Consider the failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the CSV Data Cleaning Pipeline feature" — produce a step-by-step implementation sequence with CSV parser / row validator / column type mapper / error report / cleaned output as the target.
- "Design CSV Data Cleaning Pipeline changes" — document trade-offs, addressing Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.
__USB_SKILL_B999A4490ECFFF70__

write_file "$PACK_DIR/skills/database-migration-safety-plan.md" <<'__USB_SKILL_017741546E23251A__'
---
description: "[Database Migration Safety] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan."
slug: database-migration-safety-plan
name: Database Migration Safety: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:database-migration-safety, workflow:plan, planning, database, migration, safety
---

# Database Migration Safety: Plan

[Database Migration Safety] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..

## When to use it
A change to "Database Migration Safety" needs to be designed first. Consider the common failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users." and the best practice "Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Database Migration Safety. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. The output artifact is batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Consider the failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Database Migration Safety feature" — produce a step-by-step implementation sequence with batch migration / expand-contract pattern / zero-downtime migration / rollback plan as the target.
- "Design Database Migration Safety changes" — document trade-offs, addressing Running a long-running migration (e.
__USB_SKILL_017741546E23251A__

write_file "$PACK_DIR/skills/data-warehouse-schema-plan.md" <<'__USB_SKILL_FAF402E1627D8ECE__'
---
description: "[Data Warehouse Schema Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets star schema / fact table / dimension table / ETL pipeline spec."
slug: data-warehouse-schema-plan
name: Data Warehouse Schema Design: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:data-warehouse-schema, workflow:plan, planning, data, warehouse, schema
---

# Data Warehouse Schema Design: Plan

[Data Warehouse Schema Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..

## When to use it
A change to "Data Warehouse Schema Design" needs to be designed first. Consider the common failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries." and the best practice "Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Data Warehouse Schema Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. The output artifact is star schema / fact table / dimension table / ETL pipeline spec. Consider the failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific star schema / fact table / dimension table / ETL pipeline spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Data Warehouse Schema Design feature" — produce a step-by-step implementation sequence with star schema / fact table / dimension table / ETL pipeline spec as the target.
- "Design Data Warehouse Schema Design changes" — document trade-offs, addressing Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.
__USB_SKILL_FAF402E1627D8ECE__

write_file "$PACK_DIR/skills/design-token-system-plan.md" <<'__USB_SKILL_EE5930117A111FF6__'
---
description: "[Design Token Systems] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets token JSON / CSS custom properties / theme switcher / token documentation."
slug: design-token-system-plan
name: Design Token Systems: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:design-token-system, workflow:plan, planning, design, tokens, components
---

# Design Token Systems: Plan

[Design Token Systems] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..

## When to use it
A change to "Design Token Systems" needs to be designed first. Consider the common failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file." and the best practice "Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Design Token Systems. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. The output artifact is token JSON / CSS custom properties / theme switcher / token documentation. Consider the failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Design Token Systems feature" — produce a step-by-step implementation sequence with token JSON / CSS custom properties / theme switcher / token documentation as the target.
- "Design Design Token Systems changes" — document trade-offs, addressing Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.
__USB_SKILL_EE5930117A111FF6__

write_file "$PACK_DIR/skills/docker-compose-networking-plan.md" <<'__USB_SKILL_78CFCF564879055B__'
---
description: "[Docker Compose Networking] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets docker-compose.yml / network config / healthcheck / depends_on condition."
slug: docker-compose-networking-plan
name: Docker Compose Networking: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:docker-compose-networking, workflow:plan, planning, docker, networking, devops
---

# Docker Compose Networking: Plan

[Docker Compose Networking] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..

## When to use it
A change to "Docker Compose Networking" needs to be designed first. Consider the common failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name." and the best practice "All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Docker Compose Networking. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. The output artifact is docker-compose.yml / network config / healthcheck / depends_on condition. Consider the failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Docker Compose Networking feature" — produce a step-by-step implementation sequence with docker-compose.yml / network config / healthcheck / depends_on condition as the target.
- "Design Docker Compose Networking changes" — document trade-offs, addressing Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.
__USB_SKILL_78CFCF564879055B__

write_file "$PACK_DIR/skills/docker-multistage-plan.md" <<'__USB_SKILL_544513E20EB7E964__'
---
description: "[Docker Multi-Stage Builds] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets multi-stage Dockerfile / .dockerignore / slim base image switch."
slug: docker-multistage-plan
name: Docker Multi-Stage Builds: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:docker-multistage, workflow:plan, planning, docker, build, devops
---

# Docker Multi-Stage Builds: Plan

[Docker Multi-Stage Builds] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..

## When to use it
A change to "Docker Multi-Stage Builds" needs to be designed first. Consider the common failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure." and the best practice "Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Docker Multi-Stage Builds. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. The output artifact is multi-stage Dockerfile / .dockerignore / slim base image switch. Consider the failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Docker Multi-Stage Builds feature" — produce a step-by-step implementation sequence with multi-stage Dockerfile / .dockerignore / slim base image switch as the target.
- "Design Docker Multi-Stage Builds changes" — document trade-offs, addressing Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.
__USB_SKILL_544513E20EB7E964__

write_file "$PACK_DIR/skills/drizzle-schema-design-plan.md" <<'__USB_SKILL_3F268DA2EE956F42__'
---
description: "[Drizzle Schema Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets schema.ts / relation map / migration SQL / Drizzle query builder."
slug: drizzle-schema-design-plan
name: Drizzle Schema Design: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:drizzle-schema-design, workflow:plan, planning, drizzle, schema, database
---

# Drizzle Schema Design: Plan

[Drizzle Schema Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..

## When to use it
A change to "Drizzle Schema Design" needs to be designed first. Consider the common failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster." and the best practice "Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Drizzle Schema Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. The output artifact is schema.ts / relation map / migration SQL / Drizzle query builder. Consider the failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Drizzle Schema Design feature" — produce a step-by-step implementation sequence with schema.ts / relation map / migration SQL / Drizzle query builder as the target.
- "Design Drizzle Schema Design changes" — document trade-offs, addressing Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.
__USB_SKILL_3F268DA2EE956F42__

write_file "$PACK_DIR/skills/error-monitoring-setup-plan.md" <<'__USB_SKILL_2F9C7205C6A169C3__'
---
description: "[Error Monitoring & Alerting Setup] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring."
slug: error-monitoring-setup-plan
name: Error Monitoring & Alerting Setup: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:error-monitoring-setup, workflow:plan, planning, monitoring, errors, alerts
---

# Error Monitoring & Alerting Setup: Plan

[Error Monitoring & Alerting Setup] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..

## When to use it
A change to "Error Monitoring & Alerting Setup" needs to be designed first. Consider the common failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains." and the best practice "Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).". Produce a plan before writing any code.

## Protocol
You are designing a plan for Error Monitoring & Alerting Setup. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. The output artifact is Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Consider the failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Error Monitoring & Alerting Setup feature" — produce a step-by-step implementation sequence with Sentry project config / alert rule / error grouping / source map upload / performance monitoring as the target.
- "Design Error Monitoring & Alerting Setup changes" — document trade-offs, addressing Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.
__USB_SKILL_2F9C7205C6A169C3__

write_file "$PACK_DIR/skills/fastapi-dependencies-plan.md" <<'__USB_SKILL_077198B3D9D0678E__'
---
description: "[FastAPI Dependency Injection] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets dependency / lifespan handler / override for testing."
slug: fastapi-dependencies-plan
name: FastAPI Dependency Injection: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:fastapi-dependencies, workflow:plan, planning, fastapi, dependencies, api
---

# FastAPI Dependency Injection: Plan

[FastAPI Dependency Injection] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..

## When to use it
A change to "FastAPI Dependency Injection" needs to be designed first. Consider the common failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection." and the best practice "Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().". Produce a plan before writing any code.

## Protocol
You are designing a plan for FastAPI Dependency Injection. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. The output artifact is dependency / lifespan handler / override for testing. Consider the failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific dependency / lifespan handler / override for testing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the FastAPI Dependency Injection feature" — produce a step-by-step implementation sequence with dependency / lifespan handler / override for testing as the target.
- "Design FastAPI Dependency Injection changes" — document trade-offs, addressing Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.
__USB_SKILL_077198B3D9D0678E__

write_file "$PACK_DIR/skills/feature-flags-plan.md" <<'__USB_SKILL_A5654E6263A35277__'
---
description: "[Feature Flags & Gradual Rollouts] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag."
slug: feature-flags-plan
name: Feature Flags & Gradual Rollouts: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:feature-flags, workflow:plan, planning, feature-flags, rollout, devops
---

# Feature Flags & Gradual Rollouts: Plan

[Feature Flags & Gradual Rollouts] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..

## When to use it
A change to "Feature Flags & Gradual Rollouts" needs to be designed first. Consider the common failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags." and the best practice "Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Feature Flags & Gradual Rollouts. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. The output artifact is flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Consider the failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Feature Flags & Gradual Rollouts feature" — produce a step-by-step implementation sequence with flag provider config / gradual rollout target / flag cleanup plan / A/B test flag as the target.
- "Design Feature Flags & Gradual Rollouts changes" — document trade-offs, addressing Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.
__USB_SKILL_A5654E6263A35277__

write_file "$PACK_DIR/skills/git-conflict-resolution-plan.md" <<'__USB_SKILL_AD85FF5BD46A445A__'
---
description: "[Git Conflict Resolution] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message."
slug: git-conflict-resolution-plan
name: Git Conflict Resolution: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:git-conflict-resolution, workflow:plan, planning, git, conflicts, workflow
---

# Git Conflict Resolution: Plan

[Git Conflict Resolution] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..

## When to use it
A change to "Git Conflict Resolution" needs to be designed first. Consider the common failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs." and the best practice "For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Git Conflict Resolution. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. The output artifact is conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Consider the failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Git Conflict Resolution feature" — produce a step-by-step implementation sequence with conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message as the target.
- "Design Git Conflict Resolution changes" — document trade-offs, addressing Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.
__USB_SKILL_AD85FF5BD46A445A__

write_file "$PACK_DIR/skills/github-actions-pipeline-plan.md" <<'__USB_SKILL_BFC5DEC10C823F5F__'
---
description: "[GitHub Actions Pipeline Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets workflow YAML / cache config / matrix build / conditional job execution."
slug: github-actions-pipeline-plan
name: GitHub Actions Pipeline Optimisation: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:github-actions-pipeline, workflow:plan, planning, github-actions, ci, devops
---

# GitHub Actions Pipeline Optimisation: Plan

[GitHub Actions Pipeline Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..

## When to use it
A change to "GitHub Actions Pipeline Optimisation" needs to be designed first. Consider the common failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope." and the best practice "Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.". Produce a plan before writing any code.

## Protocol
You are designing a plan for GitHub Actions Pipeline Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. The output artifact is workflow YAML / cache config / matrix build / conditional job execution. Consider the failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific workflow YAML / cache config / matrix build / conditional job execution this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the GitHub Actions Pipeline Optimisation feature" — produce a step-by-step implementation sequence with workflow YAML / cache config / matrix build / conditional job execution as the target.
- "Design GitHub Actions Pipeline Optimisation changes" — document trade-offs, addressing Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.
__USB_SKILL_BFC5DEC10C823F5F__

write_file "$PACK_DIR/skills/graphql-n-plus-one-plan.md" <<'__USB_SKILL_8E04B1AAD3407D0D__'
---
description: "[GraphQL N+1 Query Prevention] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis."
slug: graphql-n-plus-one-plan
name: GraphQL N+1 Query Prevention: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:graphql-n-plus-one, workflow:plan, planning, graphql, n-plus-one, performance
---

# GraphQL N+1 Query Prevention: Plan

[GraphQL N+1 Query Prevention] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..

## When to use it
A change to "GraphQL N+1 Query Prevention" needs to be designed first. Consider the common failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children." and the best practice "Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.". Produce a plan before writing any code.

## Protocol
You are designing a plan for GraphQL N+1 Query Prevention. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. The output artifact is DataLoader instance / batch load function / resolver refactor / query complexity analysis. Consider the failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the GraphQL N+1 Query Prevention feature" — produce a step-by-step implementation sequence with DataLoader instance / batch load function / resolver refactor / query complexity analysis as the target.
- "Design GraphQL N+1 Query Prevention changes" — document trade-offs, addressing A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.
__USB_SKILL_8E04B1AAD3407D0D__

write_file "$PACK_DIR/skills/jest-test-optimization-plan.md" <<'__USB_SKILL_07E20DFD85DE244C__'
---
description: "[Jest Test Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking."
slug: jest-test-optimization-plan
name: Jest Test Optimisation: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:jest-test-optimization, workflow:plan, planning, jest, testing, optimisation
---

# Jest Test Optimisation: Plan

[Jest Test Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..

## When to use it
A change to "Jest Test Optimisation" needs to be designed first. Consider the common failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes." and the best practice "Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Jest Test Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. The output artifact is jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Consider the failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Jest Test Optimisation feature" — produce a step-by-step implementation sequence with jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking as the target.
- "Design Jest Test Optimisation changes" — document trade-offs, addressing Running the entire test suite on every change, taking minutes even for small incremental code changes.
__USB_SKILL_07E20DFD85DE244C__

write_file "$PACK_DIR/skills/json-schema-validation-plan.md" <<'__USB_SKILL_83929C94ACC49FAB__'
---
description: "[JSON Schema Validation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets JSON Schema / validator middleware / type guard / error message / response parser."
slug: json-schema-validation-plan
name: JSON Schema Validation: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:json-schema-validation, workflow:plan, planning, json, validation, api
---

# JSON Schema Validation: Plan

[JSON Schema Validation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..

## When to use it
A change to "JSON Schema Validation" needs to be designed first. Consider the common failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly." and the best practice "Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.". Produce a plan before writing any code.

## Protocol
You are designing a plan for JSON Schema Validation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. The output artifact is JSON Schema / validator middleware / type guard / error message / response parser. Consider the failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the JSON Schema Validation feature" — produce a step-by-step implementation sequence with JSON Schema / validator middleware / type guard / error message / response parser as the target.
- "Design JSON Schema Validation changes" — document trade-offs, addressing Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.
__USB_SKILL_83929C94ACC49FAB__

write_file "$PACK_DIR/skills/kubernetes-hpa-plan.md" <<'__USB_SKILL_AD90169813259F5B__'
---
description: "[Kubernetes Horizontal Pod Autoscaling] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config."
slug: kubernetes-hpa-plan
name: Kubernetes Horizontal Pod Autoscaling: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-hpa, workflow:plan, planning, kubernetes, autoscaling, devops
---

# Kubernetes Horizontal Pod Autoscaling: Plan

[Kubernetes Horizontal Pod Autoscaling] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..

## When to use it
A change to "Kubernetes Horizontal Pod Autoscaling" needs to be designed first. Consider the common failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment." and the best practice "Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Kubernetes Horizontal Pod Autoscaling. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. The output artifact is HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Consider the failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Kubernetes Horizontal Pod Autoscaling feature" — produce a step-by-step implementation sequence with HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config as the target.
- "Design Kubernetes Horizontal Pod Autoscaling changes" — document trade-offs, addressing HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.
__USB_SKILL_AD90169813259F5B__

write_file "$PACK_DIR/skills/kubernetes-pod-lifecycle-plan.md" <<'__USB_SKILL_BEB5A2BD5C74DE6D__'
---
description: "[Kubernetes Pod Lifecycle] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container."
slug: kubernetes-pod-lifecycle-plan
name: Kubernetes Pod Lifecycle: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-pod-lifecycle, workflow:plan, planning, kubernetes, pods, devops
---

# Kubernetes Pod Lifecycle: Plan

[Kubernetes Pod Lifecycle] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..

## When to use it
A change to "Kubernetes Pod Lifecycle" needs to be designed first. Consider the common failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready." and the best practice "Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Kubernetes Pod Lifecycle. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. The output artifact is deployment.yaml / startup probe / readiness probe / liveness probe / init container. Consider the failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Kubernetes Pod Lifecycle feature" — produce a step-by-step implementation sequence with deployment.yaml / startup probe / readiness probe / liveness probe / init container as the target.
- "Design Kubernetes Pod Lifecycle changes" — document trade-offs, addressing Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.
__USB_SKILL_BEB5A2BD5C74DE6D__

write_file "$PACK_DIR/skills/context-window-budget-plan.md" <<'__USB_SKILL_5CFE450479E9EB9F__'
---
description: "[LLM Context Window Budget Management] Design a change with explicit assumptions, success criteria, and rollback instructions Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard."
slug: context-window-budget-plan
name: LLM Context Window Budget Management: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:context-window-budget, workflow:plan, planning, context, tokens, llm, memory, summarization
---

# LLM Context Window Budget Management: Plan

[LLM Context Window Budget Management] Design a change with explicit assumptions, success criteria, and rollback instructions Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..

## When to use it
A change to "LLM Context Window Budget Management" needs to be designed first. Consider the common failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness." and the best practice "Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.". Produce a plan before writing any code.

## Protocol
You are designing a plan for LLM Context Window Budget Management. Design a change with explicit assumptions, success criteria, and rollback instructions. Reference the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. The output artifact is trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Consider the failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves.

## Output contract
- **md** (markdown): MD output
- **json** (json): JSON output
- **chk** (checklist): CHK output

## Examples
- "Plan the LLM Context Window Budget Management feature" — produce a step-by-step implementation sequence with trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard as the target.
- "Design LLM Context Window Budget Management changes" — document trade-offs, addressing Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content.
__USB_SKILL_5CFE450479E9EB9F__

write_file "$PACK_DIR/skills/mcp-tool-design-plan.md" <<'__USB_SKILL_9489BCA9631FE9C3__'
---
description: "[MCP Tool Design & Best Practices] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets MCP tool descriptor / resource definition / prompt template / server metadata."
slug: mcp-tool-design-plan
name: MCP Tool Design & Best Practices: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:mcp-tool-design, workflow:plan, planning, mcp, tools, agents
---

# MCP Tool Design & Best Practices: Plan

[MCP Tool Design & Best Practices] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..

## When to use it
A change to "MCP Tool Design & Best Practices" needs to be designed first. Consider the common failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent." and the best practice "Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.". Produce a plan before writing any code.

## Protocol
You are designing a plan for MCP Tool Design & Best Practices. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. The output artifact is MCP tool descriptor / resource definition / prompt template / server metadata. Consider the failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the MCP Tool Design & Best Practices feature" — produce a step-by-step implementation sequence with MCP tool descriptor / resource definition / prompt template / server metadata as the target.
- "Design MCP Tool Design & Best Practices changes" — document trade-offs, addressing Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.
__USB_SKILL_9489BCA9631FE9C3__

write_file "$PACK_DIR/skills/message-queues-plan.md" <<'__USB_SKILL_97D0EA8A1B65C308__'
---
description: "[Message Queues & Background Jobs] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets queue producer / worker / dead-letter handler / retry policy."
slug: message-queues-plan
name: Message Queues & Background Jobs: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:message-queues, workflow:plan, planning, queue, background-jobs, backend
---

# Message Queues & Background Jobs: Plan

[Message Queues & Background Jobs] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..

## When to use it
A change to "Message Queues & Background Jobs" needs to be designed first. Consider the common failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled." and the best practice "Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Message Queues & Background Jobs. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. The output artifact is queue producer / worker / dead-letter handler / retry policy. Consider the failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific queue producer / worker / dead-letter handler / retry policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Message Queues & Background Jobs feature" — produce a step-by-step implementation sequence with queue producer / worker / dead-letter handler / retry policy as the target.
- "Design Message Queues & Background Jobs changes" — document trade-offs, addressing Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.
__USB_SKILL_97D0EA8A1B65C308__

write_file "$PACK_DIR/skills/multi-tenant-isolation-plan.md" <<'__USB_SKILL_0D4335561B337914__'
---
description: "[Multi-Tenant Data Isolation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder."
slug: multi-tenant-isolation-plan
name: Multi-Tenant Data Isolation: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:multi-tenant-isolation, workflow:plan, planning, multi-tenant, saas, database
---

# Multi-Tenant Data Isolation: Plan

[Multi-Tenant Data Isolation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..

## When to use it
A change to "Multi-Tenant Data Isolation" needs to be designed first. Consider the common failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data." and the best practice "Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Multi-Tenant Data Isolation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. The output artifact is RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Consider the failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Multi-Tenant Data Isolation feature" — produce a step-by-step implementation sequence with RLS policy / tenant context middleware / session variable injection / tenant-aware query builder as the target.
- "Design Multi-Tenant Data Isolation changes" — document trade-offs, addressing Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.
__USB_SKILL_0D4335561B337914__

write_file "$PACK_DIR/skills/nextjs-api-routes-plan.md" <<'__USB_SKILL_6C098C18DD4099B2__'
---
description: "[Next.js API Routes & Route Handlers] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets route.ts handler / server action / API client wrapper / error boundary."
slug: nextjs-api-routes-plan
name: Next.js API Routes & Route Handlers: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-api-routes, workflow:plan, planning, nextjs, api, backend
---

# Next.js API Routes & Route Handlers: Plan

[Next.js API Routes & Route Handlers] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..

## When to use it
A change to "Next.js API Routes & Route Handlers" needs to be designed first. Consider the common failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component." and the best practice "All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Next.js API Routes & Route Handlers. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. The output artifact is route.ts handler / server action / API client wrapper / error boundary. Consider the failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific route.ts handler / server action / API client wrapper / error boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Next.js API Routes & Route Handlers feature" — produce a step-by-step implementation sequence with route.ts handler / server action / API client wrapper / error boundary as the target.
- "Design Next.js API Routes & Route Handlers changes" — document trade-offs, addressing Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.
__USB_SKILL_6C098C18DD4099B2__

write_file "$PACK_DIR/skills/nextjs-data-fetching-plan.md" <<'__USB_SKILL_A3E423906C26BA1F__'
---
description: "[Next.js Data Fetching Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets server fetch / React cache wrapper / streaming suspense boundary."
slug: nextjs-data-fetching-plan
name: Next.js Data Fetching Patterns: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-data-fetching, workflow:plan, planning, nextjs, data-fetching, fullstack
---

# Next.js Data Fetching Patterns: Plan

[Next.js Data Fetching Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..

## When to use it
A change to "Next.js Data Fetching Patterns" needs to be designed first. Consider the common failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests." and the best practice "Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Next.js Data Fetching Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. The output artifact is server fetch / React cache wrapper / streaming suspense boundary. Consider the failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server fetch / React cache wrapper / streaming suspense boundary this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Next.js Data Fetching Patterns feature" — produce a step-by-step implementation sequence with server fetch / React cache wrapper / streaming suspense boundary as the target.
- "Design Next.js Data Fetching Patterns changes" — document trade-offs, addressing Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.
__USB_SKILL_A3E423906C26BA1F__

write_file "$PACK_DIR/skills/nextjs-middleware-plan.md" <<'__USB_SKILL_9A729C6F07E2973A__'
---
description: "[Next.js Middleware & Edge Runtime] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing."
slug: nextjs-middleware-plan
name: Next.js Middleware & Edge Runtime: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-middleware, workflow:plan, planning, nextjs, middleware, edge
---

# Next.js Middleware & Edge Runtime: Plan

[Next.js Middleware & Edge Runtime] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..

## When to use it
A change to "Next.js Middleware & Edge Runtime" needs to be designed first. Consider the common failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes." and the best practice "Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Next.js Middleware & Edge Runtime. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. The output artifact is middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Consider the failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Next.js Middleware & Edge Runtime feature" — produce a step-by-step implementation sequence with middleware.ts / rewrite rule / cookie-based redirect / geolocation routing as the target.
- "Design Next.js Middleware & Edge Runtime changes" — document trade-offs, addressing Using Node.
__USB_SKILL_9A729C6F07E2973A__

write_file "$PACK_DIR/skills/node-error-handling-plan.md" <<'__USB_SKILL_FFAD305660E90DA3__'
---
description: "[Node.js Error Handling & Resilience] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets global error handler / async wrapper / structured error response / retry logic."
slug: node-error-handling-plan
name: Node.js Error Handling & Resilience: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:node-error-handling, workflow:plan, planning, node, error-handling, backend
---

# Node.js Error Handling & Resilience: Plan

[Node.js Error Handling & Resilience] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..

## When to use it
A change to "Node.js Error Handling & Resilience" needs to be designed first. Consider the common failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context." and the best practice "Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Node.js Error Handling & Resilience. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. The output artifact is global error handler / async wrapper / structured error response / retry logic. Consider the failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific global error handler / async wrapper / structured error response / retry logic this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Node.js Error Handling & Resilience feature" — produce a step-by-step implementation sequence with global error handler / async wrapper / structured error response / retry logic as the target.
- "Design Node.js Error Handling & Resilience changes" — document trade-offs, addressing Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.
__USB_SKILL_FFAD305660E90DA3__

write_file "$PACK_DIR/skills/node-streams-plan.md" <<'__USB_SKILL_15C3C1B65F0AD243__'
---
description: "[Node.js Streams & Backpressure] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Readable/Writable stream / Transform / pipeline() refactor."
slug: node-streams-plan
name: Node.js Streams & Backpressure: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:node-streams, workflow:plan, planning, node, streams, performance
---

# Node.js Streams & Backpressure: Plan

[Node.js Streams & Backpressure] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..

## When to use it
A change to "Node.js Streams & Backpressure" needs to be designed first. Consider the common failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams." and the best practice "Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Node.js Streams & Backpressure. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. The output artifact is Readable/Writable stream / Transform / pipeline() refactor. Consider the failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Readable/Writable stream / Transform / pipeline() refactor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Node.js Streams & Backpressure feature" — produce a step-by-step implementation sequence with Readable/Writable stream / Transform / pipeline() refactor as the target.
- "Design Node.js Streams & Backpressure changes" — document trade-offs, addressing Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.
__USB_SKILL_15C3C1B65F0AD243__

write_file "$PACK_DIR/skills/oauth-flows-plan.md" <<'__USB_SKILL_8C8C434802BDB338__'
---
description: "[OAuth 2.0 Flows & Token Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler."
slug: oauth-flows-plan
name: OAuth 2.0 Flows & Token Management: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:oauth-flows, workflow:plan, planning, oauth, auth, security
---

# OAuth 2.0 Flows & Token Management: Plan

[OAuth 2.0 Flows & Token Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..

## When to use it
A change to "OAuth 2.0 Flows & Token Management" needs to be designed first. Consider the common failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation." and the best practice "Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.". Produce a plan before writing any code.

## Protocol
You are designing a plan for OAuth 2.0 Flows & Token Management. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. The output artifact is OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Consider the failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the OAuth 2.0 Flows & Token Management feature" — produce a step-by-step implementation sequence with OAuth callback / token refresh / PKCE flow / httpOnly cookie handler as the target.
- "Design OAuth 2.0 Flows & Token Management changes" — document trade-offs, addressing Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.
__USB_SKILL_8C8C434802BDB338__

write_file "$PACK_DIR/skills/openapi-spec-plan.md" <<'__USB_SKILL_3DE54BD644056CFC__'
---
description: "[OpenAPI Specification & Validation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets openapi.yaml / code-first generator / request/response validation middleware."
slug: openapi-spec-plan
name: OpenAPI Specification & Validation: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:openapi-spec, workflow:plan, planning, openapi, api, contract
---

# OpenAPI Specification & Validation: Plan

[OpenAPI Specification & Validation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..

## When to use it
A change to "OpenAPI Specification & Validation" needs to be designed first. Consider the common failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code." and the best practice "Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.". Produce a plan before writing any code.

## Protocol
You are designing a plan for OpenAPI Specification & Validation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. The output artifact is openapi.yaml / code-first generator / request/response validation middleware. Consider the failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific openapi.yaml / code-first generator / request/response validation middleware this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the OpenAPI Specification & Validation feature" — produce a step-by-step implementation sequence with openapi.yaml / code-first generator / request/response validation middleware as the target.
- "Design OpenAPI Specification & Validation changes" — document trade-offs, addressing Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.
__USB_SKILL_3DE54BD644056CFC__

write_file "$PACK_DIR/skills/playwright-selectors-plan.md" <<'__USB_SKILL_AE360756A90E5268__'
---
description: "[Playwright Selectors & Locators] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture."
slug: playwright-selectors-plan
name: Playwright Selectors & Locators: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:playwright-selectors, workflow:plan, planning, playwright, testing, e2e
---

# Playwright Selectors & Locators: Plan

[Playwright Selectors & Locators] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..

## When to use it
A change to "Playwright Selectors & Locators" needs to be designed first. Consider the common failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update." and the best practice "Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Playwright Selectors & Locators. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. The output artifact is locator refactor / test fixture / POM (Page Object Model) / custom fixture. Consider the failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Playwright Selectors & Locators feature" — produce a step-by-step implementation sequence with locator refactor / test fixture / POM (Page Object Model) / custom fixture as the target.
- "Design Playwright Selectors & Locators changes" — document trade-offs, addressing Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.
__USB_SKILL_AE360756A90E5268__

write_file "$PACK_DIR/skills/prompt-injection-defense-plan.md" <<'__USB_SKILL_1E58097B4F58EB8D__'
---
description: "[Prompt Injection Defense] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator."
slug: prompt-injection-defense-plan
name: Prompt Injection Defense: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:prompt-injection-defense, workflow:plan, planning, prompt, security, llm
---

# Prompt Injection Defense: Plan

[Prompt Injection Defense] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..

## When to use it
A change to "Prompt Injection Defense" needs to be designed first. Consider the common failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'." and the best practice "Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Prompt Injection Defense. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. The output artifact is defensive system prompt / input sanitizer / instruction guardrail / output validator. Consider the failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Prompt Injection Defense feature" — produce a step-by-step implementation sequence with defensive system prompt / input sanitizer / instruction guardrail / output validator as the target.
- "Design Prompt Injection Defense changes" — document trade-offs, addressing Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.
__USB_SKILL_1E58097B4F58EB8D__

write_file "$PACK_DIR/skills/python-async-plan.md" <<'__USB_SKILL_0770491D85EAC6EF__'
---
description: "[Python Async/Await Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets async/await refactor / asyncio.gather / async context manager."
slug: python-async-plan
name: Python Async/Await Patterns: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:python-async, workflow:plan, planning, python, async, performance
---

# Python Async/Await Patterns: Plan

[Python Async/Await Patterns] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..

## When to use it
A change to "Python Async/Await Patterns" needs to be designed first. Consider the common failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions." and the best practice "Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Python Async/Await Patterns. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. The output artifact is async/await refactor / asyncio.gather / async context manager. Consider the failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific async/await refactor / asyncio.gather / async context manager this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Python Async/Await Patterns feature" — produce a step-by-step implementation sequence with async/await refactor / asyncio.gather / async context manager as the target.
- "Design Python Async/Await Patterns changes" — document trade-offs, addressing Blocking the event loop by using synchronous requests or time.
__USB_SKILL_0770491D85EAC6EF__

write_file "$PACK_DIR/skills/python-file-io-plan.md" <<'__USB_SKILL_B42F6C38B90ADF2B__'
---
description: "[Python File I/O & Encoding] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets pathlib refactor / encoding-safe file reader / batch file processor."
slug: python-file-io-plan
name: Python File I/O & Encoding: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:python-file-io, workflow:plan, planning, python, file-io, scripting
---

# Python File I/O & Encoding: Plan

[Python File I/O & Encoding] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..

## When to use it
A change to "Python File I/O & Encoding" needs to be designed first. Consider the common failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content." and the best practice "Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Python File I/O & Encoding. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. The output artifact is pathlib refactor / encoding-safe file reader / batch file processor. Consider the failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Python File I/O & Encoding feature" — produce a step-by-step implementation sequence with pathlib refactor / encoding-safe file reader / batch file processor as the target.
- "Design Python File I/O & Encoding changes" — document trade-offs, addressing Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.
__USB_SKILL_B42F6C38B90ADF2B__

write_file "$PACK_DIR/skills/rag-chunking-plan.md" <<'__USB_SKILL_59AE592D335F907E__'
---
description: "[RAG Chunking Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment."
slug: rag-chunking-plan
name: RAG Chunking Strategies: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:rag-chunking, workflow:plan, planning, rag, chunking, retrieval
---

# RAG Chunking Strategies: Plan

[RAG Chunking Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..

## When to use it
A change to "RAG Chunking Strategies" needs to be designed first. Consider the common failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality." and the best practice "Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.". Produce a plan before writing any code.

## Protocol
You are designing a plan for RAG Chunking Strategies. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. The output artifact is semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Consider the failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the RAG Chunking Strategies feature" — produce a step-by-step implementation sequence with semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment as the target.
- "Design RAG Chunking Strategies changes" — document trade-offs, addressing Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.
__USB_SKILL_59AE592D335F907E__

write_file "$PACK_DIR/skills/rate-limiting-proxy-plan.md" <<'__USB_SKILL_FEC33830399E412A__'
---
description: "[Rate Limiting & API Gateway Proxy] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation."
slug: rate-limiting-proxy-plan
name: Rate Limiting & API Gateway Proxy: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:rate-limiting-proxy, workflow:plan, planning, rate-limiting, proxy, security
---

# Rate Limiting & API Gateway Proxy: Plan

[Rate Limiting & API Gateway Proxy] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..

## When to use it
A change to "Rate Limiting & API Gateway Proxy" needs to be designed first. Consider the common failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources." and the best practice "Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Rate Limiting & API Gateway Proxy. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. The output artifact is NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Consider the failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Rate Limiting & API Gateway Proxy feature" — produce a step-by-step implementation sequence with NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation as the target.
- "Design Rate Limiting & API Gateway Proxy changes" — document trade-offs, addressing Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.
__USB_SKILL_FEC33830399E412A__

write_file "$PACK_DIR/skills/react-server-components-plan.md" <<'__USB_SKILL_F2035A3648E9A672__'
---
description: "[React Server Components] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets server component / client boundary refactor / streaming fallback."
slug: react-server-components-plan
name: React Server Components: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:react-server-components, workflow:plan, planning, react, rsc, frontend
---

# React Server Components: Plan

[React Server Components] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..

## When to use it
A change to "React Server Components" needs to be designed first. Consider the common failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file." and the best practice "Keep data fetching and heavy logic in server components; pass results as props to client islands.". Produce a plan before writing any code.

## Protocol
You are designing a plan for React Server Components. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. The output artifact is server component / client boundary refactor / streaming fallback. Consider the failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server component / client boundary refactor / streaming fallback this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the React Server Components feature" — produce a step-by-step implementation sequence with server component / client boundary refactor / streaming fallback as the target.
- "Design React Server Components changes" — document trade-offs, addressing Accidentally making a server component a client component by using hooks or event handlers in the wrong file.
__USB_SKILL_F2035A3648E9A672__

write_file "$PACK_DIR/skills/react-state-plan.md" <<'__USB_SKILL_7008A69561F369F0__'
---
description: "[React State Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice."
slug: react-state-plan
name: React State Management: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:react-state, workflow:plan, planning, react, state, frontend
---

# React State Management: Plan

[React State Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..

## When to use it
A change to "React State Management" needs to be designed first. Consider the common failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation." and the best practice "Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.". Produce a plan before writing any code.

## Protocol
You are designing a plan for React State Management. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. The output artifact is useState / useReducer / useContext hook refactor, zustand or jotai store slice. Consider the failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the React State Management feature" — produce a step-by-step implementation sequence with useState / useReducer / useContext hook refactor, zustand or jotai store slice as the target.
- "Design React State Management changes" — document trade-offs, addressing Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.
__USB_SKILL_7008A69561F369F0__

write_file "$PACK_DIR/skills/reasoning-architect.md" <<'__USB_SKILL_7D9BFDCF7D1E75FD__'
---
description: "Breaks complex, multi-step tasks into a structured plan with explicit assumptions, success criteria, and a minimax strategy: minimal effort for maximum verifiable impact. Every step includes a rollback path. Call this when a task spans multiple systems, is vaguely defined, or carries risk of cascading failures."
slug: reasoning-architect
name: Reasoning Architect
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: planning, decomposition, risk-management
---

# Reasoning Architect

Breaks complex, multi-step tasks into a structured plan with explicit assumptions, success criteria, and a minimax strategy: minimal effort for maximum verifiable impact. Every step includes a rollback path.

## When to use it
Call this when a task spans multiple systems, is vaguely defined, or carries risk of cascading failures.

## Protocol
Restate the goal in one sentence. List all implicit assumptions. Define success criteria as concrete, testable outcomes. Decompose into smallest viable steps. For each step: expected output, boundary risk, verification command, and rollback instruction. Optimise for the shortest path to a working increment. If any step requires a decision, present options with trade-offs in a table.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- 'Add a payment system' → produce a plan covering Stripe integration, webhook handling, idempotency, and failure recovery.
- 'Migrate database' → schema diff, data migration script, rollback query, and read-only mode during cutover.
__USB_SKILL_7D9BFDCF7D1E75FD__

write_file "$PACK_DIR/skills/redis-caching-plan.md" <<'__USB_SKILL_EF01FFDAA7E3441B__'
---
description: "[Redis Caching Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy."
slug: redis-caching-plan
name: Redis Caching Strategies: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:redis-caching, workflow:plan, planning, redis, caching, performance
---

# Redis Caching Strategies: Plan

[Redis Caching Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..

## When to use it
A change to "Redis Caching Strategies" needs to be designed first. Consider the common failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time." and the best practice "Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Redis Caching Strategies. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. The output artifact is cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Consider the failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Redis Caching Strategies feature" — produce a step-by-step implementation sequence with cache wrapper / mutex lock / stale-while-revalidate / TTL policy as the target.
- "Design Redis Caching Strategies changes" — document trade-offs, addressing Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.
__USB_SKILL_EF01FFDAA7E3441B__

write_file "$PACK_DIR/skills/rest-pagination-plan.md" <<'__USB_SKILL_B8D152712BC0C0CE__'
---
description: "[REST Pagination Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope."
slug: rest-pagination-plan
name: REST Pagination Design: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:rest-pagination, workflow:plan, planning, rest, pagination, api
---

# REST Pagination Design: Plan

[REST Pagination Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..

## When to use it
A change to "REST Pagination Design" needs to be designed first. Consider the common failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows." and the best practice "Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.". Produce a plan before writing any code.

## Protocol
You are designing a plan for REST Pagination Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. The output artifact is cursor pagination / offset pagination fallback / total count optimisation / response envelope. Consider the failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the REST Pagination Design feature" — produce a step-by-step implementation sequence with cursor pagination / offset pagination fallback / total count optimisation / response envelope as the target.
- "Design REST Pagination Design changes" — document trade-offs, addressing Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.
__USB_SKILL_B8D152712BC0C0CE__

write_file "$PACK_DIR/skills/secrets-rotation-plan.md" <<'__USB_SKILL_C9FFB8EF26A9209E__'
---
description: "[Secrets Rotation Policy] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets rotation script / vault integration / lease management / incident response plan."
slug: secrets-rotation-plan
name: Secrets Rotation Policy: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:secrets-rotation, workflow:plan, planning, secrets, security, rotation
---

# Secrets Rotation Policy: Plan

[Secrets Rotation Policy] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..

## When to use it
A change to "Secrets Rotation Policy" needs to be designed first. Consider the common failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak." and the best practice "Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Secrets Rotation Policy. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. The output artifact is rotation script / vault integration / lease management / incident response plan. Consider the failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific rotation script / vault integration / lease management / incident response plan this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Secrets Rotation Policy feature" — produce a step-by-step implementation sequence with rotation script / vault integration / lease management / incident response plan as the target.
- "Design Secrets Rotation Policy changes" — document trade-offs, addressing Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.
__USB_SKILL_C9FFB8EF26A9209E__

write_file "$PACK_DIR/skills/shell-script-robustness-plan.md" <<'__USB_SKILL_82F9F33BF6C9E3C9__'
---
description: "[Shell Script Robustness & Safety] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function."
slug: shell-script-robustness-plan
name: Shell Script Robustness & Safety: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:shell-script-robustness, workflow:plan, planning, shell, scripting, safety
---

# Shell Script Robustness & Safety: Plan

[Shell Script Robustness & Safety] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..

## When to use it
A change to "Shell Script Robustness & Safety" needs to be designed first. Consider the common failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage." and the best practice "Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Shell Script Robustness & Safety. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. The output artifact is set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Consider the failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Shell Script Robustness & Safety feature" — produce a step-by-step implementation sequence with set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function as the target.
- "Design Shell Script Robustness & Safety changes" — document trade-offs, addressing Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.
__USB_SKILL_82F9F33BF6C9E3C9__

write_file "$PACK_DIR/skills/sql-query-optimization-plan.md" <<'__USB_SKILL_F5A679AF4FFA5D29__'
---
description: "[SQL Query Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index."
slug: sql-query-optimization-plan
name: SQL Query Optimisation: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:sql-query-optimization, workflow:plan, planning, sql, optimization, database
---

# SQL Query Optimisation: Plan

[SQL Query Optimisation] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..

## When to use it
A change to "SQL Query Optimisation" needs to be designed first. Consider the common failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs." and the best practice "Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.". Produce a plan before writing any code.

## Protocol
You are designing a plan for SQL Query Optimisation. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. The output artifact is indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Consider the failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the SQL Query Optimisation feature" — produce a step-by-step implementation sequence with indexed query / composite index / EXPLAIN ANALYSE plan / partial index as the target.
- "Design SQL Query Optimisation changes" — document trade-offs, addressing Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.
__USB_SKILL_F5A679AF4FFA5D29__

write_file "$PACK_DIR/skills/stealth-web-research-plan.md" <<'__USB_SKILL_DB87E8BF8783BD0A__'
---
description: "[Stealth Web Research & Harvesting] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages."
slug: stealth-web-research-plan
name: Stealth Web Research & Harvesting: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:stealth-web-research, workflow:plan, planning, stealth, scraping, research, anti-bot
---

# Stealth Web Research & Harvesting: Plan

[Stealth Web Research & Harvesting] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..

## When to use it
A change to "Stealth Web Research & Harvesting" needs to be designed first. Consider the common failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests." and the best practice "Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Stealth Web Research & Harvesting. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. The output artifact is clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Consider the failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Stealth Web Research & Harvesting feature" — produce a step-by-step implementation sequence with clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages as the target.
- "Design Stealth Web Research & Harvesting changes" — document trade-offs, addressing Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.
__USB_SKILL_DB87E8BF8783BD0A__

write_file "$PACK_DIR/skills/stripe-webhook-idempotency-plan.md" <<'__USB_SKILL_21C9DE223408C51C__'
---
description: "[Stripe Webhook Idempotency] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery."
slug: stripe-webhook-idempotency-plan
name: Stripe Webhook Idempotency: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:stripe-webhook-idempotency, workflow:plan, planning, stripe, webhook, payments
---

# Stripe Webhook Idempotency: Plan

[Stripe Webhook Idempotency] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..

## When to use it
A change to "Stripe Webhook Idempotency" needs to be designed first. Consider the common failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations." and the best practice "Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Stripe Webhook Idempotency. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. The output artifact is Webhook handler / idempotency key check / event deduplication / failed payment recovery. Consider the failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Stripe Webhook Idempotency feature" — produce a step-by-step implementation sequence with Webhook handler / idempotency key check / event deduplication / failed payment recovery as the target.
- "Design Stripe Webhook Idempotency changes" — document trade-offs, addressing Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.
__USB_SKILL_21C9DE223408C51C__

write_file "$PACK_DIR/skills/supabase-rls-plan.md" <<'__USB_SKILL_94A4C70C152FAFCA__'
---
description: "[Supabase Row-Level Security] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets RLS policy / policy test / security definer function / admin bypass."
slug: supabase-rls-plan
name: Supabase Row-Level Security: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:supabase-rls, workflow:plan, planning, supabase, rls, security
---

# Supabase Row-Level Security: Plan

[Supabase Row-Level Security] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..

## When to use it
A change to "Supabase Row-Level Security" needs to be designed first. Consider the common failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data." and the best practice "Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Supabase Row-Level Security. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. The output artifact is RLS policy / policy test / security definer function / admin bypass. Consider the failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / policy test / security definer function / admin bypass this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Supabase Row-Level Security feature" — produce a step-by-step implementation sequence with RLS policy / policy test / security definer function / admin bypass as the target.
- "Design Supabase Row-Level Security changes" — document trade-offs, addressing RLS policies that are too permissive (using 'true' instead of 'auth.
__USB_SKILL_94A4C70C152FAFCA__

write_file "$PACK_DIR/skills/terraform-state-plan.md" <<'__USB_SKILL_C7175C9609E5A6C9__'
---
description: "[Terraform State Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets backend config / state migration plan / state locking config / remote state datasource."
slug: terraform-state-plan
name: Terraform State Management: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:terraform-state, workflow:plan, planning, terraform, state, iac
---

# Terraform State Management: Plan

[Terraform State Management] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..

## When to use it
A change to "Terraform State Management" needs to be designed first. Consider the common failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure." and the best practice "Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Terraform State Management. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. The output artifact is backend config / state migration plan / state locking config / remote state datasource. Consider the failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific backend config / state migration plan / state locking config / remote state datasource this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Terraform State Management feature" — produce a step-by-step implementation sequence with backend config / state migration plan / state locking config / remote state datasource as the target.
- "Design Terraform State Management changes" — document trade-offs, addressing Losing the .
__USB_SKILL_C7175C9609E5A6C9__

write_file "$PACK_DIR/skills/typescript-generics-plan.md" <<'__USB_SKILL_5A1637D5C5D95DCF__'
---
description: "[TypeScript Generics & Advanced Types] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets generic type / conditional type / mapped type / branded type."
slug: typescript-generics-plan
name: TypeScript Generics & Advanced Types: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:typescript-generics, workflow:plan, planning, typescript, generics, type-system
---

# TypeScript Generics & Advanced Types: Plan

[TypeScript Generics & Advanced Types] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..

## When to use it
A change to "TypeScript Generics & Advanced Types" needs to be designed first. Consider the common failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)." and the best practice "Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.". Produce a plan before writing any code.

## Protocol
You are designing a plan for TypeScript Generics & Advanced Types. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. The output artifact is generic type / conditional type / mapped type / branded type. Consider the failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice). and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific generic type / conditional type / mapped type / branded type this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the TypeScript Generics & Advanced Types feature" — produce a step-by-step implementation sequence with generic type / conditional type / mapped type / branded type as the target.
- "Design TypeScript Generics & Advanced Types changes" — document trade-offs, addressing Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).
__USB_SKILL_5A1637D5C5D95DCF__

write_file "$PACK_DIR/skills/user-onboarding-flow-plan.md" <<'__USB_SKILL_86A5323176CC2AD9__'
---
description: "[User Onboarding Flow Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec."
slug: user-onboarding-flow-plan
name: User Onboarding Flow Design: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:user-onboarding-flow, workflow:plan, planning, ux, onboarding, product
---

# User Onboarding Flow Design: Plan

[User Onboarding Flow Design] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..

## When to use it
A change to "User Onboarding Flow Design" needs to be designed first. Consider the common failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value." and the best practice "Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.". Produce a plan before writing any code.

## Protocol
You are designing a plan for User Onboarding Flow Design. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. The output artifact is onboarding wizard / feature checklist / in-app guide / first-run experience spec. Consider the failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the User Onboarding Flow Design feature" — produce a step-by-step implementation sequence with onboarding wizard / feature checklist / in-app guide / first-run experience spec as the target.
- "Design User Onboarding Flow Design changes" — document trade-offs, addressing Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.
__USB_SKILL_86A5323176CC2AD9__

write_file "$PACK_DIR/skills/vercel-env-vars-plan.md" <<'__USB_SKILL_06E5180F9CE738D0__'
---
description: "[Vercel Environment Variables] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets vercel.json env group / preview env config / Edge Config / KV store."
slug: vercel-env-vars-plan
name: Vercel Environment Variables: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:vercel-env-vars, workflow:plan, planning, vercel, env, deployment
---

# Vercel Environment Variables: Plan

[Vercel Environment Variables] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..

## When to use it
A change to "Vercel Environment Variables" needs to be designed first. Consider the common failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments." and the best practice "Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Vercel Environment Variables. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. The output artifact is vercel.json env group / preview env config / Edge Config / KV store. Consider the failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific vercel.json env group / preview env config / Edge Config / KV store this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Vercel Environment Variables feature" — produce a step-by-step implementation sequence with vercel.json env group / preview env config / Edge Config / KV store as the target.
- "Design Vercel Environment Variables changes" — document trade-offs, addressing Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.
__USB_SKILL_06E5180F9CE738D0__

write_file "$PACK_DIR/skills/web-scraping-ethics-plan.md" <<'__USB_SKILL_AC749BA8819E60E3__'
---
description: "[Web Scraping Ethics & Compliance] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper."
slug: web-scraping-ethics-plan
name: Web Scraping Ethics & Compliance: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:web-scraping-ethics, workflow:plan, planning, scraping, ethics, research
---

# Web Scraping Ethics & Compliance: Plan

[Web Scraping Ethics & Compliance] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..

## When to use it
A change to "Web Scraping Ethics & Compliance" needs to be designed first. Consider the common failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues." and the best practice "Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Web Scraping Ethics & Compliance. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. The output artifact is robots.txt check / polite scraper / rate-limited crawler / cached scraper. Consider the failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Web Scraping Ethics & Compliance feature" — produce a step-by-step implementation sequence with robots.txt check / polite scraper / rate-limited crawler / cached scraper as the target.
- "Design Web Scraping Ethics & Compliance changes" — document trade-offs, addressing Scraping a website that explicitly prohibits it in robots.
__USB_SKILL_AC749BA8819E60E3__

write_file "$PACK_DIR/skills/websocket-reconnection-plan.md" <<'__USB_SKILL_E1BD6F3FDF08B364__'
---
description: "[WebSocket Reconnection Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets WebSocket client / reconnection logic / heartbeat / connection status component."
slug: websocket-reconnection-plan
name: WebSocket Reconnection Strategies: Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:websocket-reconnection, workflow:plan, planning, websocket, realtime, frontend
---

# WebSocket Reconnection Strategies: Plan

[WebSocket Reconnection Strategies] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..

## When to use it
A change to "WebSocket Reconnection Strategies" needs to be designed first. Consider the common failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state." and the best practice "Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.". Produce a plan before writing any code.

## Protocol
You are designing a plan for WebSocket Reconnection Strategies. Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. The output artifact is WebSocket client / reconnection logic / heartbeat / connection status component. Consider the failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state. and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the WebSocket Reconnection Strategies feature" — produce a step-by-step implementation sequence with WebSocket client / reconnection logic / heartbeat / connection status component as the target.
- "Design WebSocket Reconnection Strategies changes" — document trade-offs, addressing Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.
__USB_SKILL_E1BD6F3FDF08B364__

write_file "$PACK_DIR/skills/web-vitals-optimization-plan.md" <<'__USB_SKILL_61ABF58006D8E5CA__'
---
description: "[Web Vitals Optimisation (LCP/CLS/INP)] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis."
slug: web-vitals-optimization-plan
name: Web Vitals Optimisation (LCP/CLS/INP): Plan
category: Planning
risk: low
model_agnostic: true
agent_agnostic: true
tags: target:web-vitals-optimization, workflow:plan, planning, performance, web-vitals, optimisation
---

# Web Vitals Optimisation (LCP/CLS/INP): Plan

[Web Vitals Optimisation (LCP/CLS/INP)] Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..

## When to use it
A change to "Web Vitals Optimisation (LCP/CLS/INP)" needs to be designed first. Consider the common failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)." and the best practice "Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.". Produce a plan before writing any code.

## Protocol
You are designing a plan for Web Vitals Optimisation (LCP/CLS/INP). Design an architecture, data flow, component tree, or migration strategy. Document all assumptions, list trade-offs, produce a step-by-step implementation sequence, and identify potential failure points before any code is written.. Reference the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. The output artifact is image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Consider the failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions). and propose mitigations.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves.

## Output contract
- **response** (markdown): Structured markdown response.
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Plan the Web Vitals Optimisation (LCP/CLS/INP) feature" — produce a step-by-step implementation sequence with image optimisation / font display swap / critical CSS / lazy load / bundle analysis as the target.
- "Design Web Vitals Optimisation (LCP/CLS/INP) changes" — document trade-offs, addressing Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).
__USB_SKILL_61ABF58006D8E5CA__

write_file "$PACK_DIR/skills/incident-debugger.md" <<'__USB_SKILL_997B82C8CF5C2766__'
---
description: "Systematically isolates the root cause of a failure by separating symptoms from causes, generating minimal hypotheses, and testing them one at a time with minimal code changes. Call this when a build fails, a test fails, an API returns an unexpected status, or a runtime error occurs."
slug: incident-debugger
name: Incident Debugger
category: Quality
risk: medium
model_agnostic: true
agent_agnostic: true
tags: debugging, root-cause, triage
---

# Incident Debugger

Systematically isolates the root cause of a failure by separating symptoms from causes, generating minimal hypotheses, and testing them one at a time with minimal code changes.

## When to use it
Call this when a build fails, a test fails, an API returns an unexpected status, or a runtime error occurs.

## Protocol
Read the error output. Identify the first concrete error line (file, line number, and error code). Separate the symptom (what the user sees) from the root cause (the underlying code or configuration issue). Generate up to three minimal-fix hypotheses, ordered by likelihood. For each hypothesis, write a single verification command (type-check a specific file, curl a single endpoint, run one test). Execute hypotheses one at a time. After finding the fix, run the full verification-runner sequence.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **log** (text, required): Error log, stack trace, or failure description.

## Output contract
- **response** (markdown): Structured markdown response.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- Build error: 'Module not found: ./Button' → hypothesis 1: file renamed, verify with 'ls src/components/Button*'. Hypothesis 2: import path case mismatch, verify with 'grep -r "Button" src/'.
- API returns 500: check application logs → hypothesis 1: database connection pool exhausted, verify with 'db pool status'. Hypothesis 2: unhandled promise rejection, verify with 'node --trace-warnings'.
__USB_SKILL_997B82C8CF5C2766__

write_file "$PACK_DIR/skills/verification-runner.md" <<'__USB_SKILL_67C81571EAAA9F47__'
---
description: "Defines and executes a standard post-change verification sequence: type-check → lint → unit tests → build → smoke tests. Adjusts rigour based on change risk level. Call this after completing any code change to confirm nothing is broken."
slug: verification-runner
name: Verification Runner
category: Quality
risk: low
model_agnostic: true
agent_agnostic: true
tags: verification, quality, ci-simulation
---

# Verification Runner

Defines and executes a standard post-change verification sequence: type-check → lint → unit tests → build → smoke tests. Adjusts rigour based on change risk level.

## When to use it
Call this after completing any code change to confirm nothing is broken.

## Protocol
Assess the change risk: low (comments, config, docs), medium (new function, refactor within a file), high (schema change, dependency upgrade, public API change). Based on risk, select verification steps from: (1) type-check, (2) lint, (3) affected unit tests, (4) full test suite, (5) build, (6) smoke test (curl endpoints, load page). For each step provide the exact command, expected outcome, and where to look on failure. Execute the sequence and report pass/fail per step.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.

## Output contract
- **commands** (command): Safe execution, verification or automation commands.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- Low-risk (documentation update): run 'npm run lint' and 'npm run build'. Medium-risk (new API endpoint): run 'npm run typecheck', test new endpoint with curl, run 'npm run build'. High-risk (schema migration): run all steps plus 'drizzle-kit push' and a rollback test.
__USB_SKILL_67C81571EAAA9F47__

write_file "$PACK_DIR/skills/a-b-testing-framework-harden.md" <<'__USB_SKILL_A8CB09C15F7FA86F__'
---
description: "[A/B Testing Framework] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets experiment spec / variant assignment / metric definition / statistical analysis script."
slug: a-b-testing-framework-harden
name: A/B Testing Framework: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:a-b-testing-framework, workflow:harden, security, ab-testing, experiments, product
---

# A/B Testing Framework: Harden

[A/B Testing Framework] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets experiment spec / variant assignment / metric definition / statistical analysis script. Known failure pattern: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle..

## When to use it
Audit and harden "A/B Testing Framework". The common failure pattern "Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise." may be present. Follow the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Produce a risk-ranked list of findings.

## Protocol
You are hardening A/B Testing Framework. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise.. Apply the best practice: Use an online sample size calculator before starting the test. Define the minimum detectable effect and ensure the test runs for at least one full business cycle.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific experiment spec / variant assignment / metric definition / statistical analysis script this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden A/B Testing Framework" — audit for Running A/B tests with sample sizes too small to reach statistical significance, leading to decisions based on noise and apply the best practice fix.
- "Secure A/B Testing Framework setup" — review experiment spec / variant assignment / metric definition / statistical analysis script and produce a risk-ranked list.
__USB_SKILL_A8CB09C15F7FA86F__

write_file "$PACK_DIR/skills/a11y-aria-patterns-harden.md" <<'__USB_SKILL_3B047937FFB51687__'
---
description: "[Accessibility ARIA Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script."
slug: a11y-aria-patterns-harden
name: Accessibility ARIA Patterns: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:a11y-aria-patterns, workflow:harden, security, accessibility, aria, testing
---

# Accessibility ARIA Patterns: Harden

[Accessibility ARIA Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets ARIA attribute refactor / keyboard navigation / focus management / screen reader test script. Known failure pattern: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader..

## When to use it
Audit and harden "Accessibility ARIA Patterns". The common failure pattern "Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers." may be present. Follow the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Accessibility ARIA Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Adding ARIA attributes that conflict with native HTML semantics (e.g., role='button' on a <button> element), confusing screen readers.. Apply the best practice: Use native HTML elements whenever possible. Only use ARIA to supplement missing semantics, never to override existing ones. Test with a real screen reader.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ARIA attribute refactor / keyboard navigation / focus management / screen reader test script this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Accessibility ARIA Patterns" — audit for Adding ARIA attributes that conflict with native HTML semantics (e and apply the best practice fix.
- "Secure Accessibility ARIA Patterns setup" — review ARIA attribute refactor / keyboard navigation / focus management / screen reader test script and produce a risk-ranked list.
__USB_SKILL_3B047937FFB51687__

write_file "$PACK_DIR/skills/agent-tool-binding-harden.md" <<'__USB_SKILL_D9FA56A1D9748E55__'
---
description: "[Agent Tool Binding & Dispatch] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets router tool / domain group / dynamic tool injection / tool usage statistics."
slug: agent-tool-binding-harden
name: Agent Tool Binding & Dispatch: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:agent-tool-binding, workflow:harden, security, agents, tool-binding, orchestration
---

# Agent Tool Binding & Dispatch: Harden

[Agent Tool Binding & Dispatch] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets router tool / domain group / dynamic tool injection / tool usage statistics. Known failure pattern: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step..

## When to use it
Audit and harden "Agent Tool Binding & Dispatch". The common failure pattern "Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly." may be present. Follow the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Agent Tool Binding & Dispatch. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly.. Apply the best practice: Group tools by domain and offer a 'router' tool first. The agent picks a domain, then that domain's tools are injected. This reduces the tool set per step.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific router tool / domain group / dynamic tool injection / tool usage statistics this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Agent Tool Binding & Dispatch" — audit for Giving the agent too many tools at once, causing it to spend more time choosing than executing, and increasing token usage significantly and apply the best practice fix.
- "Secure Agent Tool Binding & Dispatch setup" — review router tool / domain group / dynamic tool injection / tool usage statistics and produce a risk-ranked list.
__USB_SKILL_D9FA56A1D9748E55__

write_file "$PACK_DIR/skills/analytics-metric-definition-harden.md" <<'__USB_SKILL_E19106C1692A0BE9__'
---
description: "[Analytics Metric Definitions] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation."
slug: analytics-metric-definition-harden
name: Analytics Metric Definitions: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:analytics-metric-definition, workflow:harden, security, analytics, metrics, data
---

# Analytics Metric Definitions: Harden

[Analytics Metric Definitions] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets metric definition / dbt model / SQL logic / dashboard tile / documentation. Known failure pattern: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly..

## When to use it
Audit and harden "Analytics Metric Definitions". The common failure pattern "Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers." may be present. Follow the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Analytics Metric Definitions. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Different teams computing the same metric (e.g., 'daily active users') with different SQL logic, producing conflicting numbers.. Apply the best practice: Define every metric in a central repository as a dbt model or LookML view with a single source of truth, and document its logic explicitly.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific metric definition / dbt model / SQL logic / dashboard tile / documentation this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Analytics Metric Definitions" — audit for Different teams computing the same metric (e and apply the best practice fix.
- "Secure Analytics Metric Definitions setup" — review metric definition / dbt model / SQL logic / dashboard tile / documentation and produce a risk-ranked list.
__USB_SKILL_E19106C1692A0BE9__

write_file "$PACK_DIR/skills/adr-documentation-harden.md" <<'__USB_SKILL_B71A1272A4AFE447__'
---
description: "[Architecture Decision Records] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets ADR document / decision log / template / review workflow."
slug: adr-documentation-harden
name: Architecture Decision Records: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:adr-documentation, workflow:harden, security, documentation, adr, architecture
---

# Architecture Decision Records: Harden

[Architecture Decision Records] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets ADR document / decision log / template / review workflow. Known failure pattern: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences..

## When to use it
Audit and harden "Architecture Decision Records". The common failure pattern "Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done." may be present. Follow the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Architecture Decision Records. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done.. Apply the best practice: Write an ADR for every non-trivial decision. Include the context, considered alternatives (with pros/cons of each), the chosen option, and the consequences.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific ADR document / decision log / template / review workflow this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Architecture Decision Records" — audit for Making important architectural decisions without documenting the context, alternatives, and rationale, leaving future team members confused about why something was done and apply the best practice fix.
- "Secure Architecture Decision Records setup" — review ADR document / decision log / template / review workflow and produce a risk-ranked list.
__USB_SKILL_B71A1272A4AFE447__

write_file "$PACK_DIR/skills/aws-lambda-cold-start-harden.md" <<'__USB_SKILL_047409A22076E6A8__'
---
description: "[AWS Lambda Cold Starts] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function."
slug: aws-lambda-cold-start-harden
name: AWS Lambda Cold Starts: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:aws-lambda-cold-start, workflow:harden, security, aws, lambda, performance
---

# AWS Lambda Cold Starts: Harden

[AWS Lambda Cold Starts] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets handler refactor / SnapStart config / Provisioned Concurrency / warmer function. Known failure pattern: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions..

## When to use it
Audit and harden "AWS Lambda Cold Starts". The common failure pattern "Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler." may be present. Follow the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Produce a risk-ranked list of findings.

## Protocol
You are hardening AWS Lambda Cold Starts. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler.. Apply the best practice: Move initialisation (DB connections, config loading) outside the handler. Use Lambda SnapStart for Java or .NET. Consider Provisioned Concurrency for latency-sensitive functions.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific handler refactor / SnapStart config / Provisioned Concurrency / warmer function this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden AWS Lambda Cold Starts" — audit for Cold starts lasting multiple seconds because the function loads heavy dependencies or initialises database connections outside the handler and apply the best practice fix.
- "Secure AWS Lambda Cold Starts setup" — review handler refactor / SnapStart config / Provisioned Concurrency / warmer function and produce a risk-ranked list.
__USB_SKILL_047409A22076E6A8__

write_file "$PACK_DIR/skills/azure-bicep-harden.md" <<'__USB_SKILL_E218AA5CB0A54A9F__'
---
description: "[Azure Bicep Infrastructure] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets main.bicep / module / parameter file / azd template."
slug: azure-bicep-harden
name: Azure Bicep Infrastructure: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:azure-bicep, workflow:harden, security, azure, bicep, iac
---

# Azure Bicep Infrastructure: Harden

[Azure Bicep Infrastructure] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets main.bicep / module / parameter file / azd template. Known failure pattern: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic..

## When to use it
Audit and harden "Azure Bicep Infrastructure". The common failure pattern "Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce." may be present. Follow the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Azure Bicep Infrastructure. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce.. Apply the best practice: Always define Azure resources in Bicep or Terraform. Use parameters and modules to keep the code DRY and environment-agnostic.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific main.bicep / module / parameter file / azd template this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Azure Bicep Infrastructure" — audit for Manually creating resources in the portal without infrastructure-as-code, making environments inconsistent and hard to reproduce and apply the best practice fix.
- "Secure Azure Bicep Infrastructure setup" — review main.bicep / module / parameter file / azd template and produce a risk-ranked list.
__USB_SKILL_E218AA5CB0A54A9F__

write_file "$PACK_DIR/skills/browser-devtools-harden.md" <<'__USB_SKILL_1DBD3DDA1CEB7745__'
---
description: "[Browser DevTools & Debugging] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot."
slug: browser-devtools-harden
name: Browser DevTools & Debugging: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:browser-devtools, workflow:harden, security, browser, debugging, devtools
---

# Browser DevTools & Debugging: Harden

[Browser DevTools & Debugging] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets debugging workflow / breakpoint guide / performance recording / memory snapshot. Known failure pattern: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM..

## When to use it
Audit and harden "Browser DevTools & Debugging". The common failure pattern "Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically." may be present. Follow the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Browser DevTools & Debugging. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically.. Apply the best practice: Start with the Network panel to confirm the request/response are correct, then use Sources to set breakpoints, then Elements to inspect the DOM.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific debugging workflow / breakpoint guide / performance recording / memory snapshot this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Browser DevTools & Debugging" — audit for Trying to debug frontend issues by guessing instead of using the Elements, Console, Network, and Sources panels systematically and apply the best practice fix.
- "Secure Browser DevTools & Debugging setup" — review debugging workflow / breakpoint guide / performance recording / memory snapshot and produce a risk-ranked list.
__USB_SKILL_1DBD3DDA1CEB7745__

write_file "$PACK_DIR/skills/cli-tool-design-harden.md" <<'__USB_SKILL_F004C3B38AAEF694__'
---
description: "[CLI Tool Design Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CLI scaffolding / argument parser / exit code handler / --json output mode."
slug: cli-tool-design-harden
name: CLI Tool Design Patterns: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:cli-tool-design, workflow:harden, security, cli, devtools, scripting
---

# CLI Tool Design Patterns: Harden

[CLI Tool Design Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CLI scaffolding / argument parser / exit code handler / --json output mode. Known failure pattern: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output..

## When to use it
Audit and harden "CLI Tool Design Patterns". The common failure pattern "Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with." may be present. Follow the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Produce a risk-ranked list of findings.

## Protocol
You are hardening CLI Tool Design Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with.. Apply the best practice: Always exit 0 on success, non-zero on failure. Print errors to stderr, output to stdout. Support --json flag for machine-readable output.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CLI scaffolding / argument parser / exit code handler / --json output mode this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden CLI Tool Design Patterns" — audit for Building CLI tools that print output without usable exit codes (always exits 0) or swallow error messages, making them impossible to script with and apply the best practice fix.
- "Secure CLI Tool Design Patterns setup" — review CLI scaffolding / argument parser / exit code handler / --json output mode and produce a risk-ranked list.
__USB_SKILL_F004C3B38AAEF694__

write_file "$PACK_DIR/skills/cloud-cost-optimization-harden.md" <<'__USB_SKILL_94BCAB4E369D80FA__'
---
description: "[Cloud Cost Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report."
slug: cloud-cost-optimization-harden
name: Cloud Cost Optimisation: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:cloud-cost-optimization, workflow:harden, security, cloud, cost, optimization
---

# Cloud Cost Optimisation: Harden

[Cloud Cost Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report. Known failure pattern: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments..

## When to use it
Audit and harden "Cloud Cost Optimisation". The common failure pattern "Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours." may be present. Follow the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Cloud Cost Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours.. Apply the best practice: Right-size instances based on actual usage metrics (not peak theoretical load). Use auto-stop schedules for non-production environments.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Cloud Cost Optimisation" — audit for Running oversized instances 'just in case', or leaving development/staging resources running 24/7 when they are only needed during working hours and apply the best practice fix.
- "Secure Cloud Cost Optimisation setup" — review right-sizing recommendation / auto-stop schedule / reserved instance plan / unused resource report and produce a risk-ranked list.
__USB_SKILL_94BCAB4E369D80FA__

write_file "$PACK_DIR/skills/code-review-checklist-harden.md" <<'__USB_SKILL_96638B6B9B6DDC64__'
---
description: "[Code Review Checklist] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets review checklist / automated review comment / risk classification / diff summary."
slug: code-review-checklist-harden
name: Code Review Checklist: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:code-review-checklist, workflow:harden, security, code-review, quality, checklist
---

# Code Review Checklist: Harden

[Code Review Checklist] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets review checklist / automated review comment / risk classification / diff summary. Known failure pattern: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order..

## When to use it
Audit and harden "Code Review Checklist". The common failure pattern "Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions." may be present. Follow the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Code Review Checklist. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions.. Apply the best practice: Use a structured review checklist: correctness, security, performance, test coverage, error handling, and code style — in that order.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific review checklist / automated review comment / risk classification / diff summary this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Code Review Checklist" — audit for Reviewers focusing only on code style and missing architectural issues like missing error handling, security vulnerabilities, or performance regressions and apply the best practice fix.
- "Secure Code Review Checklist setup" — review review checklist / automated review comment / risk classification / diff summary and produce a risk-ranked list.
__USB_SKILL_96638B6B9B6DDC64__

write_file "$PACK_DIR/skills/convex-functions-harden.md" <<'__USB_SKILL_8CC07B18384B9EEF__'
---
description: "[Convex Functions & Mutations] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets mutation / query / action / component / scheduler job."
slug: convex-functions-harden
name: Convex Functions & Mutations: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:convex-functions, workflow:harden, security, convex, realtime, backend
---

# Convex Functions & Mutations: Harden

[Convex Functions & Mutations] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets mutation / query / action / component / scheduler job. Known failure pattern: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back..

## When to use it
Audit and harden "Convex Functions & Mutations". The common failure pattern "Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients." may be present. Follow the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Convex Functions & Mutations. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients.. Apply the best practice: Use patch() for partial updates and batch mutations for atomic multi-document writes. Avoid reading a document before immediately writing it back.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific mutation / query / action / component / scheduler job this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Convex Functions & Mutations" — audit for Accidentally creating OCC (Optimistic Concurrency Control) conflicts by reading and writing the same document in rapid succession from multiple clients and apply the best practice fix.
- "Secure Convex Functions & Mutations setup" — review mutation / query / action / component / scheduler job and produce a risk-ranked list.
__USB_SKILL_8CC07B18384B9EEF__

write_file "$PACK_DIR/skills/cron-job-reliability-harden.md" <<'__USB_SKILL_8C46AB5239E844F2__'
---
description: "[Cron Job & Scheduled Task Reliability] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets crontab entry / log rotation / idempotency guard / failure alert integration."
slug: cron-job-reliability-harden
name: Cron Job & Scheduled Task Reliability: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:cron-job-reliability, workflow:harden, security, cron, scheduling, reliability
---

# Cron Job & Scheduled Task Reliability: Harden

[Cron Job & Scheduled Task Reliability] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets crontab entry / log rotation / idempotency guard / failure alert integration. Known failure pattern: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects..

## When to use it
Audit and harden "Cron Job & Scheduled Task Reliability". The common failure pattern "Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time." may be present. Follow the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Cron Job & Scheduled Task Reliability. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time.. Apply the best practice: Redirect cron output to a log file with timestamp. Use || to send failure alerts. Implement job idempotency so running it multiple times has no side effects.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific crontab entry / log rotation / idempotency guard / failure alert integration this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Cron Job & Scheduled Task Reliability" — audit for Cron jobs failing silently because output is not logged, or running the same job multiple times when the system is down at the scheduled time and apply the best practice fix.
- "Secure Cron Job & Scheduled Task Reliability setup" — review crontab entry / log rotation / idempotency guard / failure alert integration and produce a risk-ranked list.
__USB_SKILL_8C46AB5239E844F2__

write_file "$PACK_DIR/skills/css-layout-harden.md" <<'__USB_SKILL_B3F0DD26A7868281__'
---
description: "[CSS Layout & Responsiveness] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CSS layout refactor / responsive grid / container query implementation."
slug: css-layout-harden
name: CSS Layout & Responsiveness: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:css-layout, workflow:harden, security, css, layout, frontend
---

# CSS Layout & Responsiveness: Harden

[CSS Layout & Responsiveness] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CSS layout refactor / responsive grid / container query implementation. Known failure pattern: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints..

## When to use it
Audit and harden "CSS Layout & Responsiveness". The common failure pattern "Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable." may be present. Follow the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Produce a risk-ranked list of findings.

## Protocol
You are hardening CSS Layout & Responsiveness. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable.. Apply the best practice: Design for the content, not the viewport. Use clamp(), minmax(), and auto-fit/auto-fill before reaching for breakpoints.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSS layout refactor / responsive grid / container query implementation this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden CSS Layout & Responsiveness" — audit for Over-reliance on media queries when container queries or flex/grid intrinsic sizing would be simpler and more maintainable and apply the best practice fix.
- "Secure CSS Layout & Responsiveness setup" — review CSS layout refactor / responsive grid / container query implementation and produce a risk-ranked list.
__USB_SKILL_B3F0DD26A7868281__

write_file "$PACK_DIR/skills/csv-data-cleaning-harden.md" <<'__USB_SKILL_D5F97D4F7A988B69__'
---
description: "[CSV Data Cleaning Pipeline] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CSV parser / row validator / column type mapper / error report / cleaned output."
slug: csv-data-cleaning-harden
name: CSV Data Cleaning Pipeline: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:csv-data-cleaning, workflow:harden, security, data, csv, pipeline
---

# CSV Data Cleaning Pipeline: Harden

[CSV Data Cleaning Pipeline] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets CSV parser / row validator / column type mapper / error report / cleaned output. Known failure pattern: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row..

## When to use it
Audit and harden "CSV Data Cleaning Pipeline". The common failure pattern "Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines." may be present. Follow the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Produce a risk-ranked list of findings.

## Protocol
You are hardening CSV Data Cleaning Pipeline. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines.. Apply the best practice: Always use a proper CSV parser (Python's csv module, Papa Parse in JS) instead of splitting on commas. Validate column count and types for every row.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific CSV parser / row validator / column type mapper / error report / cleaned output this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden CSV Data Cleaning Pipeline" — audit for Assuming CSV values are clean and consistent, then hitting parsing errors or silent data corruption when encountering commas inside quoted fields, missing headers, or inconsistent newlines and apply the best practice fix.
- "Secure CSV Data Cleaning Pipeline setup" — review CSV parser / row validator / column type mapper / error report / cleaned output and produce a risk-ranked list.
__USB_SKILL_D5F97D4F7A988B69__

write_file "$PACK_DIR/skills/database-migration-safety-harden.md" <<'__USB_SKILL_687E56015E3B2642__'
---
description: "[Database Migration Safety] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan."
slug: database-migration-safety-harden
name: Database Migration Safety: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:database-migration-safety, workflow:harden, security, database, migration, safety
---

# Database Migration Safety: Harden

[Database Migration Safety] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets batch migration / expand-contract pattern / zero-downtime migration / rollback plan. Known failure pattern: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default..

## When to use it
Audit and harden "Database Migration Safety". The common failure pattern "Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users." may be present. Follow the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Database Migration Safety. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running a long-running migration (e.g., adding a column with a default value) that locks the table and causes downtime for active users.. Apply the best practice: Use PostgreSQL's ADD COLUMN DEFAULT (no-rewrite in recent versions) or break the migration into steps: add column without default, backfill in batches, then add default.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific batch migration / expand-contract pattern / zero-downtime migration / rollback plan this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Database Migration Safety" — audit for Running a long-running migration (e and apply the best practice fix.
- "Secure Database Migration Safety setup" — review batch migration / expand-contract pattern / zero-downtime migration / rollback plan and produce a risk-ranked list.
__USB_SKILL_687E56015E3B2642__

write_file "$PACK_DIR/skills/data-warehouse-schema-harden.md" <<'__USB_SKILL_2EF5C7F871283FE1__'
---
description: "[Data Warehouse Schema Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets star schema / fact table / dimension table / ETL pipeline spec."
slug: data-warehouse-schema-harden
name: Data Warehouse Schema Design: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:data-warehouse-schema, workflow:harden, security, data, warehouse, schema
---

# Data Warehouse Schema Design: Harden

[Data Warehouse Schema Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets star schema / fact table / dimension table / ETL pipeline spec. Known failure pattern: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time..

## When to use it
Audit and harden "Data Warehouse Schema Design". The common failure pattern "Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries." may be present. Follow the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Data Warehouse Schema Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries.. Apply the best practice: Use a star schema (one fact table, multiple dimension tables) or a wide-column denormalised table for analytical queries. Pre-join at loading time.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific star schema / fact table / dimension table / ETL pipeline spec this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Data Warehouse Schema Design" — audit for Using a highly normalised OLTP schema (3NF) directly in a data warehouse, causing complex JOINs and slow analytical queries and apply the best practice fix.
- "Secure Data Warehouse Schema Design setup" — review star schema / fact table / dimension table / ETL pipeline spec and produce a risk-ranked list.
__USB_SKILL_2EF5C7F871283FE1__

write_file "$PACK_DIR/skills/design-token-system-harden.md" <<'__USB_SKILL_A4ECB5CE5A114FF0__'
---
description: "[Design Token Systems] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets token JSON / CSS custom properties / theme switcher / token documentation."
slug: design-token-system-harden
name: Design Token Systems: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:design-token-system, workflow:harden, security, design, tokens, components
---

# Design Token Systems: Harden

[Design Token Systems] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets token JSON / CSS custom properties / theme switcher / token documentation. Known failure pattern: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values..

## When to use it
Audit and harden "Design Token Systems". The common failure pattern "Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file." may be present. Follow the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Design Token Systems. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file.. Apply the best practice: Define all visual primitives as CSS custom properties or JSON tokens. Reference them in components via token names, not literal values.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific token JSON / CSS custom properties / theme switcher / token documentation this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Design Token Systems" — audit for Hardcoding colors, spacing, or typography values in components instead of referencing design tokens, making theming impossible without changing every file and apply the best practice fix.
- "Secure Design Token Systems setup" — review token JSON / CSS custom properties / theme switcher / token documentation and produce a risk-ranked list.
__USB_SKILL_A4ECB5CE5A114FF0__

write_file "$PACK_DIR/skills/docker-compose-networking-harden.md" <<'__USB_SKILL_A6CCC80F9C28B035__'
---
description: "[Docker Compose Networking] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets docker-compose.yml / network config / healthcheck / depends_on condition."
slug: docker-compose-networking-harden
name: Docker Compose Networking: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:docker-compose-networking, workflow:harden, security, docker, networking, devops
---

# Docker Compose Networking: Harden

[Docker Compose Networking] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets docker-compose.yml / network config / healthcheck / depends_on condition. Known failure pattern: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'..

## When to use it
Audit and harden "Docker Compose Networking". The common failure pattern "Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name." may be present. Follow the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Docker Compose Networking. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name.. Apply the best practice: All services in the same docker-compose.yml are on a shared network by default. Reference other services by their service name, not 'localhost'.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific docker-compose.yml / network config / healthcheck / depends_on condition this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Docker Compose Networking" — audit for Services unable to reach each other because they are on different Docker networks, or using 'localhost' instead of the service name and apply the best practice fix.
- "Secure Docker Compose Networking setup" — review docker-compose.yml / network config / healthcheck / depends_on condition and produce a risk-ranked list.
__USB_SKILL_A6CCC80F9C28B035__

write_file "$PACK_DIR/skills/docker-multistage-harden.md" <<'__USB_SKILL_1A87DE893EAB4289__'
---
description: "[Docker Multi-Stage Builds] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets multi-stage Dockerfile / .dockerignore / slim base image switch."
slug: docker-multistage-harden
name: Docker Multi-Stage Builds: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:docker-multistage, workflow:harden, security, docker, build, devops
---

# Docker Multi-Stage Builds: Harden

[Docker Multi-Stage Builds] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets multi-stage Dockerfile / .dockerignore / slim base image switch. Known failure pattern: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app..

## When to use it
Audit and harden "Docker Multi-Stage Builds". The common failure pattern "Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure." may be present. Follow the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Docker Multi-Stage Builds. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure.. Apply the best practice: Use at least two stages: one for installing dev dependencies and building, another for copying only the production artefacts and running the app.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific multi-stage Dockerfile / .dockerignore / slim base image switch this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Docker Multi-Stage Builds" — audit for Including the entire node_modules and build toolchain in the final production image, making it unnecessarily large and insecure and apply the best practice fix.
- "Secure Docker Multi-Stage Builds setup" — review multi-stage Dockerfile / .dockerignore / slim base image switch and produce a risk-ranked list.
__USB_SKILL_1A87DE893EAB4289__

write_file "$PACK_DIR/skills/drizzle-schema-design-harden.md" <<'__USB_SKILL_2E04C528D7AC15C3__'
---
description: "[Drizzle Schema Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets schema.ts / relation map / migration SQL / Drizzle query builder."
slug: drizzle-schema-design-harden
name: Drizzle Schema Design: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:drizzle-schema-design, workflow:harden, security, drizzle, schema, database
---

# Drizzle Schema Design: Harden

[Drizzle Schema Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets schema.ts / relation map / migration SQL / Drizzle query builder. Known failure pattern: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly..

## When to use it
Audit and harden "Drizzle Schema Design". The common failure pattern "Over-using relations() when simple foreign key columns with manual joins would be clearer and faster." may be present. Follow the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Drizzle Schema Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Over-using relations() when simple foreign key columns with manual joins would be clearer and faster.. Apply the best practice: Define relations only for eagerly loaded nested data. For simple lookups, just reference the foreign key column directly.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific schema.ts / relation map / migration SQL / Drizzle query builder this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Drizzle Schema Design" — audit for Over-using relations() when simple foreign key columns with manual joins would be clearer and faster and apply the best practice fix.
- "Secure Drizzle Schema Design setup" — review schema.ts / relation map / migration SQL / Drizzle query builder and produce a risk-ranked list.
__USB_SKILL_2E04C528D7AC15C3__

write_file "$PACK_DIR/skills/error-monitoring-setup-harden.md" <<'__USB_SKILL_E1D34C6662E330ED__'
---
description: "[Error Monitoring & Alerting Setup] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring."
slug: error-monitoring-setup-harden
name: Error Monitoring & Alerting Setup: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:error-monitoring-setup, workflow:harden, security, monitoring, errors, alerts
---

# Error Monitoring & Alerting Setup: Harden

[Error Monitoring & Alerting Setup] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Sentry project config / alert rule / error grouping / source map upload / performance monitoring. Known failure pattern: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold)..

## When to use it
Audit and harden "Error Monitoring & Alerting Setup". The common failure pattern "Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains." may be present. Follow the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Produce a risk-ranked list of findings.

## Protocol
You are hardening Error Monitoring & Alerting Setup. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains.. Apply the best practice: Configure at least two alerts: one for new errors (errors appearing for the first time) and one for error spikes (error count exceeding a threshold).. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Sentry project config / alert rule / error grouping / source map upload / performance monitoring this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Error Monitoring & Alerting Setup" — audit for Setting up error monitoring (Sentry, Datadog) but configuring no alerts, so errors accumulate silently until a user complains and apply the best practice fix.
- "Secure Error Monitoring & Alerting Setup setup" — review Sentry project config / alert rule / error grouping / source map upload / performance monitoring and produce a risk-ranked list.
__USB_SKILL_E1D34C6662E330ED__

write_file "$PACK_DIR/skills/fastapi-dependencies-harden.md" <<'__USB_SKILL_0B11136EA67A8684__'
---
description: "[FastAPI Dependency Injection] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets dependency / lifespan handler / override for testing."
slug: fastapi-dependencies-harden
name: FastAPI Dependency Injection: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:fastapi-dependencies, workflow:harden, security, fastapi, dependencies, api
---

# FastAPI Dependency Injection: Harden

[FastAPI Dependency Injection] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets dependency / lifespan handler / override for testing. Known failure pattern: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends()..

## When to use it
Audit and harden "FastAPI Dependency Injection". The common failure pattern "Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection." may be present. Follow the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Produce a risk-ranked list of findings.

## Protocol
You are hardening FastAPI Dependency Injection. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection.. Apply the best practice: Define shared resources (DB pool, HTTP client) as lifespan-managed dependencies and inject them via Depends().. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific dependency / lifespan handler / override for testing this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden FastAPI Dependency Injection" — audit for Re-initialising the same database connection or HTTP client inside every route instead of using FastAPI's dependency injection and apply the best practice fix.
- "Secure FastAPI Dependency Injection setup" — review dependency / lifespan handler / override for testing and produce a risk-ranked list.
__USB_SKILL_0B11136EA67A8684__

write_file "$PACK_DIR/skills/feature-flags-harden.md" <<'__USB_SKILL_BAC4B36B709ACD47__'
---
description: "[Feature Flags & Gradual Rollouts] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag."
slug: feature-flags-harden
name: Feature Flags & Gradual Rollouts: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:feature-flags, workflow:harden, security, feature-flags, rollout, devops
---

# Feature Flags & Gradual Rollouts: Harden

[Feature Flags & Gradual Rollouts] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets flag provider config / gradual rollout target / flag cleanup plan / A/B test flag. Known failure pattern: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely..

## When to use it
Audit and harden "Feature Flags & Gradual Rollouts". The common failure pattern "Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags." may be present. Follow the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Feature Flags & Gradual Rollouts. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags.. Apply the best practice: Treat feature flags as temporary. After a flag has been fully rolled out and stable for one release cycle, remove the flag code and the flag condition entirely.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific flag provider config / gradual rollout target / flag cleanup plan / A/B test flag this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Feature Flags & Gradual Rollouts" — audit for Leaving feature flag code in the codebase permanently, making the codebase harder to read and maintain, and never removing old flags and apply the best practice fix.
- "Secure Feature Flags & Gradual Rollouts setup" — review flag provider config / gradual rollout target / flag cleanup plan / A/B test flag and produce a risk-ranked list.
__USB_SKILL_BAC4B36B709ACD47__

write_file "$PACK_DIR/skills/git-conflict-resolution-harden.md" <<'__USB_SKILL_02F659B347817DE8__'
---
description: "[Git Conflict Resolution] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message."
slug: git-conflict-resolution-harden
name: Git Conflict Resolution: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:git-conflict-resolution, workflow:harden, security, git, conflicts, workflow
---

# Git Conflict Resolution: Harden

[Git Conflict Resolution] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message. Known failure pattern: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution..

## When to use it
Audit and harden "Git Conflict Resolution". The common failure pattern "Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs." may be present. Follow the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Git Conflict Resolution. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs.. Apply the best practice: For each conflicted section, trace the origin of both changes using 'git log --oneline' on the file. Understand the intent before picking a resolution.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Git Conflict Resolution" — audit for Resolving merge conflicts by blindly accepting one side without understanding why the change was made, potentially reintroducing bugs and apply the best practice fix.
- "Secure Git Conflict Resolution setup" — review conflict resolution plan / cherry-pick strategy / rebase workflow / merge commit message and produce a risk-ranked list.
__USB_SKILL_02F659B347817DE8__

write_file "$PACK_DIR/skills/github-actions-pipeline-harden.md" <<'__USB_SKILL_4C8411F0D9E54947__'
---
description: "[GitHub Actions Pipeline Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets workflow YAML / cache config / matrix build / conditional job execution."
slug: github-actions-pipeline-harden
name: GitHub Actions Pipeline Optimisation: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:github-actions-pipeline, workflow:harden, security, github-actions, ci, devops
---

# GitHub Actions Pipeline Optimisation: Harden

[GitHub Actions Pipeline Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets workflow YAML / cache config / matrix build / conditional job execution. Known failure pattern: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs..

## When to use it
Audit and harden "GitHub Actions Pipeline Optimisation". The common failure pattern "Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope." may be present. Follow the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Produce a risk-ranked list of findings.

## Protocol
You are hardening GitHub Actions Pipeline Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope.. Apply the best practice: Cache node_modules (or other dependency folders) using actions/cache with a hash of the lock file. Use paths filter to run only relevant jobs.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific workflow YAML / cache config / matrix build / conditional job execution this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden GitHub Actions Pipeline Optimisation" — audit for Long CI times caused by not caching dependencies between runs, or running the full test suite on every push regardless of change scope and apply the best practice fix.
- "Secure GitHub Actions Pipeline Optimisation setup" — review workflow YAML / cache config / matrix build / conditional job execution and produce a risk-ranked list.
__USB_SKILL_4C8411F0D9E54947__

write_file "$PACK_DIR/skills/graphql-n-plus-one-harden.md" <<'__USB_SKILL_7ED21A26128CD8A3__'
---
description: "[GraphQL N+1 Query Prevention] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis."
slug: graphql-n-plus-one-harden
name: GraphQL N+1 Query Prevention: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:graphql-n-plus-one, workflow:harden, security, graphql, n-plus-one, performance
---

# GraphQL N+1 Query Prevention: Harden

[GraphQL N+1 Query Prevention] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets DataLoader instance / batch load function / resolver refactor / query complexity analysis. Known failure pattern: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle..

## When to use it
Audit and harden "GraphQL N+1 Query Prevention". The common failure pattern "A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children." may be present. Follow the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Produce a risk-ranked list of findings.

## Protocol
You are hardening GraphQL N+1 Query Prevention. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children.. Apply the best practice: Use DataLoader to batch and cache child-loading queries. DataLoader groups all child-loading calls into a single IN query per request cycle.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific DataLoader instance / batch load function / resolver refactor / query complexity analysis this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden GraphQL N+1 Query Prevention" — audit for A resolver that fetches a parent entity, then for each child calls a separate database query, resulting in N+1 queries for N children and apply the best practice fix.
- "Secure GraphQL N+1 Query Prevention setup" — review DataLoader instance / batch load function / resolver refactor / query complexity analysis and produce a risk-ranked list.
__USB_SKILL_7ED21A26128CD8A3__

write_file "$PACK_DIR/skills/jest-test-optimization-harden.md" <<'__USB_SKILL_BB6E76DE29270D7D__'
---
description: "[Jest Test Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking."
slug: jest-test-optimization-harden
name: Jest Test Optimisation: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:jest-test-optimization, workflow:harden, security, jest, testing, optimisation
---

# Jest Test Optimisation: Harden

[Jest Test Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking. Known failure pattern: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback..

## When to use it
Audit and harden "Jest Test Optimisation". The common failure pattern "Running the entire test suite on every change, taking minutes even for small incremental code changes." may be present. Follow the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Jest Test Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Running the entire test suite on every change, taking minutes even for small incremental code changes.. Apply the best practice: Use jest --changedSince to run only tests related to changed files. Use jest --onlyChanged during development to get instant feedback.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Jest Test Optimisation" — audit for Running the entire test suite on every change, taking minutes even for small incremental code changes and apply the best practice fix.
- "Secure Jest Test Optimisation setup" — review jest config optimisation / --changedSince / --onlyChanged / test sharding / module mocking and produce a risk-ranked list.
__USB_SKILL_BB6E76DE29270D7D__

write_file "$PACK_DIR/skills/json-schema-validation-harden.md" <<'__USB_SKILL_7F27C5326220B5BC__'
---
description: "[JSON Schema Validation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets JSON Schema / validator middleware / type guard / error message / response parser."
slug: json-schema-validation-harden
name: JSON Schema Validation: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:json-schema-validation, workflow:harden, security, json, validation, api
---

# JSON Schema Validation: Harden

[JSON Schema Validation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets JSON Schema / validator middleware / type guard / error message / response parser. Known failure pattern: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation..

## When to use it
Audit and harden "JSON Schema Validation". The common failure pattern "Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly." may be present. Follow the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Produce a risk-ranked list of findings.

## Protocol
You are hardening JSON Schema Validation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly.. Apply the best practice: Always validate external JSON responses against a JSON Schema before accessing properties. Use AJV (JavaScript) or jsonschema (Python) for fast validation.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific JSON Schema / validator middleware / type guard / error message / response parser this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden JSON Schema Validation" — audit for Trusting external API responses without validating their structure, causing runtime errors when the API changes the response format unexpectedly and apply the best practice fix.
- "Secure JSON Schema Validation setup" — review JSON Schema / validator middleware / type guard / error message / response parser and produce a risk-ranked list.
__USB_SKILL_7F27C5326220B5BC__

write_file "$PACK_DIR/skills/kubernetes-hpa-harden.md" <<'__USB_SKILL_A15089C9BF529E41__'
---
description: "[Kubernetes Horizontal Pod Autoscaling] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config."
slug: kubernetes-hpa-harden
name: Kubernetes Horizontal Pod Autoscaling: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-hpa, workflow:harden, security, kubernetes, autoscaling, devops
---

# Kubernetes Horizontal Pod Autoscaling: Harden

[Kubernetes Horizontal Pod Autoscaling] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config. Known failure pattern: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined..

## When to use it
Audit and harden "Kubernetes Horizontal Pod Autoscaling". The common failure pattern "HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment." may be present. Follow the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Kubernetes Horizontal Pod Autoscaling. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment.. Apply the best practice: Always set CPU/memory requests on every container. HPA cannot scale based on resource metrics without requests defined.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Kubernetes Horizontal Pod Autoscaling" — audit for HPA not scaling because metrics-server is not installed, or because resource requests/limits are not set on the target deployment and apply the best practice fix.
- "Secure Kubernetes Horizontal Pod Autoscaling setup" — review HPA manifest / custom metric / vertical pod autoscaler / cluster autoscaler config and produce a risk-ranked list.
__USB_SKILL_A15089C9BF529E41__

write_file "$PACK_DIR/skills/kubernetes-pod-lifecycle-harden.md" <<'__USB_SKILL_0606DBFF38BD1AB3__'
---
description: "[Kubernetes Pod Lifecycle] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container."
slug: kubernetes-pod-lifecycle-harden
name: Kubernetes Pod Lifecycle: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:kubernetes-pod-lifecycle, workflow:harden, security, kubernetes, pods, devops
---

# Kubernetes Pod Lifecycle: Harden

[Kubernetes Pod Lifecycle] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets deployment.yaml / startup probe / readiness probe / liveness probe / init container. Known failure pattern: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity..

## When to use it
Audit and harden "Kubernetes Pod Lifecycle". The common failure pattern "Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready." may be present. Follow the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Kubernetes Pod Lifecycle. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready.. Apply the best practice: Implement a startup probe with a longer initial delay and a readiness probe that checks actual dependency health, not just TCP connectivity.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific deployment.yaml / startup probe / readiness probe / liveness probe / init container this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Kubernetes Pod Lifecycle" — audit for Pods stuck in CrashLoopBackOff because the application exits when a dependency (database, cache) is not yet ready and apply the best practice fix.
- "Secure Kubernetes Pod Lifecycle setup" — review deployment.yaml / startup probe / readiness probe / liveness probe / init container and produce a risk-ranked list.
__USB_SKILL_0606DBFF38BD1AB3__

write_file "$PACK_DIR/skills/context-window-budget-harden.md" <<'__USB_SKILL_290ED05FD2E6463C__'
---
description: "[LLM Context Window Budget Management] Audit for the failure pattern, apply the best practice, rank findings by severity Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard."
slug: context-window-budget-harden
name: LLM Context Window Budget Management: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:context-window-budget, workflow:harden, security, context, tokens, llm, memory, summarization
---

# LLM Context Window Budget Management: Harden

[LLM Context Window Budget Management] Audit for the failure pattern, apply the best practice, rank findings by severity Targets trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard. Known failure pattern: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible..

## When to use it
Audit and harden "LLM Context Window Budget Management". The common failure pattern "Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness." may be present. Follow the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Produce a risk-ranked list of findings.

## Protocol
You are hardening LLM Context Window Budget Management. Audit for the failure pattern, apply the best practice, rank findings by severity. Check for: Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content. Worse: re-reading the same 10MB file 50 times because each tool call rebuilds context from scratch without cache awareness.. Apply the best practice: Use sliding window summarization: keep system prompt + last 5 turns verbatim, compress older turns into a 200-token lossless summary. Aggressively cache stable prefixes (system prompt, tool schemas, file headers). Strip redundant tool outputs after they're acted on. Use semantic search to inject only relevant code chunks, never whole files. Always log token usage per turn so budget overruns are visible.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard this task involves.

## Output contract
- **md** (markdown): MD output
- **chk** (checklist): CHK output

## Examples
- "Harden LLM Context Window Budget Management" — audit for Dumping the entire conversation history plus all file contents into the LLM context window on every turn, causing immediate overflow on multi-hour sessions and burning tens of thousands of tokens on redundant content and apply the best practice fix.
- "Secure LLM Context Window Budget Management setup" — review trimmed context array / token budget report / sliding window snapshot / semantic retrieval hit list / cache hit dashboard and produce a risk-ranked list.
__USB_SKILL_290ED05FD2E6463C__

write_file "$PACK_DIR/skills/mcp-tool-design-harden.md" <<'__USB_SKILL_527625AA4209CEA4__'
---
description: "[MCP Tool Design & Best Practices] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets MCP tool descriptor / resource definition / prompt template / server metadata."
slug: mcp-tool-design-harden
name: MCP Tool Design & Best Practices: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:mcp-tool-design, workflow:harden, security, mcp, tools, agents
---

# MCP Tool Design & Best Practices: Harden

[MCP Tool Design & Best Practices] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets MCP tool descriptor / resource definition / prompt template / server metadata. Known failure pattern: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool..

## When to use it
Audit and harden "MCP Tool Design & Best Practices". The common failure pattern "Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent." may be present. Follow the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Produce a risk-ranked list of findings.

## Protocol
You are hardening MCP Tool Design & Best Practices. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent.. Apply the best practice: Prefix tool names with a namespace that reflects their domain (e.g., 'github_search_repos', 'jira_get_issue'). Always provide a detailed description of when to use each tool.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific MCP tool descriptor / resource definition / prompt template / server metadata this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden MCP Tool Design & Best Practices" — audit for Designing MCP tool names that are too generic ('search', 'get_data') causing ambiguity when multiple tools are available to the agent and apply the best practice fix.
- "Secure MCP Tool Design & Best Practices setup" — review MCP tool descriptor / resource definition / prompt template / server metadata and produce a risk-ranked list.
__USB_SKILL_527625AA4209CEA4__

write_file "$PACK_DIR/skills/message-queues-harden.md" <<'__USB_SKILL_4D357A1D4379F007__'
---
description: "[Message Queues & Background Jobs] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets queue producer / worker / dead-letter handler / retry policy."
slug: message-queues-harden
name: Message Queues & Background Jobs: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:message-queues, workflow:harden, security, queue, background-jobs, backend
---

# Message Queues & Background Jobs: Harden

[Message Queues & Background Jobs] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets queue producer / worker / dead-letter handler / retry policy. Known failure pattern: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted..

## When to use it
Audit and harden "Message Queues & Background Jobs". The common failure pattern "Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled." may be present. Follow the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Message Queues & Background Jobs. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled.. Apply the best practice: Disable auto-ack. Acknowledge only after the job has been fully processed and its result has been persisted.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific queue producer / worker / dead-letter handler / retry policy this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Message Queues & Background Jobs" — audit for Losing messages when a worker crashes before acknowledging completion, because auto-ack is enabled and apply the best practice fix.
- "Secure Message Queues & Background Jobs setup" — review queue producer / worker / dead-letter handler / retry policy and produce a risk-ranked list.
__USB_SKILL_4D357A1D4379F007__

write_file "$PACK_DIR/skills/multi-tenant-isolation-harden.md" <<'__USB_SKILL_967B64C8C3D515A8__'
---
description: "[Multi-Tenant Data Isolation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder."
slug: multi-tenant-isolation-harden
name: Multi-Tenant Data Isolation: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:multi-tenant-isolation, workflow:harden, security, multi-tenant, saas, database
---

# Multi-Tenant Data Isolation: Harden

[Multi-Tenant Data Isolation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets RLS policy / tenant context middleware / session variable injection / tenant-aware query builder. Known failure pattern: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause..

## When to use it
Audit and harden "Multi-Tenant Data Isolation". The common failure pattern "Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data." may be present. Follow the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Multi-Tenant Data Isolation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data.. Apply the best practice: Use PostgreSQL Row-Level Security with tenant_id automatically set via session variable. This guarantees isolation even if a query misses the WHERE clause.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / tenant context middleware / session variable injection / tenant-aware query builder this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Multi-Tenant Data Isolation" — audit for Using a single database with a tenant_id column but forgetting to filter by tenant_id in every query, accidentally mixing tenant data and apply the best practice fix.
- "Secure Multi-Tenant Data Isolation setup" — review RLS policy / tenant context middleware / session variable injection / tenant-aware query builder and produce a risk-ranked list.
__USB_SKILL_967B64C8C3D515A8__

write_file "$PACK_DIR/skills/nextjs-api-routes-harden.md" <<'__USB_SKILL_5A252AC7C32FBF1B__'
---
description: "[Next.js API Routes & Route Handlers] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets route.ts handler / server action / API client wrapper / error boundary."
slug: nextjs-api-routes-harden
name: Next.js API Routes & Route Handlers: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-api-routes, workflow:harden, security, nextjs, api, backend
---

# Next.js API Routes & Route Handlers: Harden

[Next.js API Routes & Route Handlers] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets route.ts handler / server action / API client wrapper / error boundary. Known failure pattern: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components..

## When to use it
Audit and harden "Next.js API Routes & Route Handlers". The common failure pattern "Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component." may be present. Follow the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Next.js API Routes & Route Handlers. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component.. Apply the best practice: All sensitive operations (DB queries, external API calls with keys) belong in API routes or server actions, never in client components.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific route.ts handler / server action / API client wrapper / error boundary this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Next.js API Routes & Route Handlers" — audit for Exposing server-side secrets to the client by accidentally importing environment variables in a 'use client' component and apply the best practice fix.
- "Secure Next.js API Routes & Route Handlers setup" — review route.ts handler / server action / API client wrapper / error boundary and produce a risk-ranked list.
__USB_SKILL_5A252AC7C32FBF1B__

write_file "$PACK_DIR/skills/nextjs-data-fetching-harden.md" <<'__USB_SKILL_3CC015EBDE739DA7__'
---
description: "[Next.js Data Fetching Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets server fetch / React cache wrapper / streaming suspense boundary."
slug: nextjs-data-fetching-harden
name: Next.js Data Fetching Patterns: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-data-fetching, workflow:harden, security, nextjs, data-fetching, fullstack
---

# Next.js Data Fetching Patterns: Harden

[Next.js Data Fetching Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets server fetch / React cache wrapper / streaming suspense boundary. Known failure pattern: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes..

## When to use it
Audit and harden "Next.js Data Fetching Patterns". The common failure pattern "Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests." may be present. Follow the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Next.js Data Fetching Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests.. Apply the best practice: Use server components for initial data fetch and pass down as props. Use React.cache() to deduplicate fetches across parallel routes.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server fetch / React cache wrapper / streaming suspense boundary this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Next.js Data Fetching Patterns" — audit for Fetching the same data in multiple server components or mixing server fetch with client fetch leading to duplicate network requests and apply the best practice fix.
- "Secure Next.js Data Fetching Patterns setup" — review server fetch / React cache wrapper / streaming suspense boundary and produce a risk-ranked list.
__USB_SKILL_3CC015EBDE739DA7__

write_file "$PACK_DIR/skills/nextjs-middleware-harden.md" <<'__USB_SKILL_1BC8F23B43EC5306__'
---
description: "[Next.js Middleware & Edge Runtime] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing."
slug: nextjs-middleware-harden
name: Next.js Middleware & Edge Runtime: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:nextjs-middleware, workflow:harden, security, nextjs, middleware, edge
---

# Next.js Middleware & Edge Runtime: Harden

[Next.js Middleware & Edge Runtime] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets middleware.ts / rewrite rule / cookie-based redirect / geolocation routing. Known failure pattern: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks..

## When to use it
Audit and harden "Next.js Middleware & Edge Runtime". The common failure pattern "Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes." may be present. Follow the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Next.js Middleware & Edge Runtime. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using Node.js APIs (fs, crypto, database drivers) inside Edge Middleware, causing runtime crashes.. Apply the best practice: Keep middleware stateless and light. Use it only for redirects, rewrites, header manipulation, and basic auth checks.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific middleware.ts / rewrite rule / cookie-based redirect / geolocation routing this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Next.js Middleware & Edge Runtime" — audit for Using Node and apply the best practice fix.
- "Secure Next.js Middleware & Edge Runtime setup" — review middleware.ts / rewrite rule / cookie-based redirect / geolocation routing and produce a risk-ranked list.
__USB_SKILL_1BC8F23B43EC5306__

write_file "$PACK_DIR/skills/node-error-handling-harden.md" <<'__USB_SKILL_DB2B83F8BAC93C75__'
---
description: "[Node.js Error Handling & Resilience] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets global error handler / async wrapper / structured error response / retry logic."
slug: node-error-handling-harden
name: Node.js Error Handling & Resilience: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:node-error-handling, workflow:harden, security, node, error-handling, backend
---

# Node.js Error Handling & Resilience: Harden

[Node.js Error Handling & Resilience] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets global error handler / async wrapper / structured error response / retry logic. Known failure pattern: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function..

## When to use it
Audit and harden "Node.js Error Handling & Resilience". The common failure pattern "Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context." may be present. Follow the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Node.js Error Handling & Resilience. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context.. Apply the best practice: Use a global error handler for uncaught exceptions and unhandled rejections. Wrap every async route handler in a higher-order catch function.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific global error handler / async wrapper / structured error response / retry logic this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Node.js Error Handling & Resilience" — audit for Unhandled promise rejections crashing the process, or try-catch blocks that swallow errors without logging context and apply the best practice fix.
- "Secure Node.js Error Handling & Resilience setup" — review global error handler / async wrapper / structured error response / retry logic and produce a risk-ranked list.
__USB_SKILL_DB2B83F8BAC93C75__

write_file "$PACK_DIR/skills/node-streams-harden.md" <<'__USB_SKILL_3F53A1FB2561756E__'
---
description: "[Node.js Streams & Backpressure] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Readable/Writable stream / Transform / pipeline() refactor."
slug: node-streams-harden
name: Node.js Streams & Backpressure: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:node-streams, workflow:harden, security, node, streams, performance
---

# Node.js Streams & Backpressure: Harden

[Node.js Streams & Backpressure] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Readable/Writable stream / Transform / pipeline() refactor. Known failure pattern: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error..

## When to use it
Audit and harden "Node.js Streams & Backpressure". The common failure pattern "Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams." may be present. Follow the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Node.js Streams & Backpressure. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams.. Apply the best practice: Use pipeline() instead of pipe() because pipeline automatically handles backpressure and destroys streams on error.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Readable/Writable stream / Transform / pipeline() refactor this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Node.js Streams & Backpressure" — audit for Reading entire files into memory instead of streaming, or ignoring backpressure signals from writable streams and apply the best practice fix.
- "Secure Node.js Streams & Backpressure setup" — review Readable/Writable stream / Transform / pipeline() refactor and produce a risk-ranked list.
__USB_SKILL_3F53A1FB2561756E__

write_file "$PACK_DIR/skills/oauth-flows-harden.md" <<'__USB_SKILL_3ECCA7E1938044BF__'
---
description: "[OAuth 2.0 Flows & Token Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler."
slug: oauth-flows-harden
name: OAuth 2.0 Flows & Token Management: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:oauth-flows, workflow:harden, security, oauth, auth
---

# OAuth 2.0 Flows & Token Management: Harden

[OAuth 2.0 Flows & Token Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets OAuth callback / token refresh / PKCE flow / httpOnly cookie handler. Known failure pattern: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use..

## When to use it
Audit and harden "OAuth 2.0 Flows & Token Management". The common failure pattern "Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation." may be present. Follow the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Produce a risk-ranked list of findings.

## Protocol
You are hardening OAuth 2.0 Flows & Token Management. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation.. Apply the best practice: Store tokens in an httpOnly cookie set by the server, not in client-side storage. Implement refresh token rotation and revoke old refresh tokens after use.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific OAuth callback / token refresh / PKCE flow / httpOnly cookie handler this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden OAuth 2.0 Flows & Token Management" — audit for Storing access tokens in localStorage, making them accessible to XSS attacks, and not implementing refresh token rotation and apply the best practice fix.
- "Secure OAuth 2.0 Flows & Token Management setup" — review OAuth callback / token refresh / PKCE flow / httpOnly cookie handler and produce a risk-ranked list.
__USB_SKILL_3ECCA7E1938044BF__

write_file "$PACK_DIR/skills/openapi-spec-harden.md" <<'__USB_SKILL_4AC3FCD56FEDB915__'
---
description: "[OpenAPI Specification & Validation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets openapi.yaml / code-first generator / request/response validation middleware."
slug: openapi-spec-harden
name: OpenAPI Specification & Validation: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:openapi-spec, workflow:harden, security, openapi, api, contract
---

# OpenAPI Specification & Validation: Harden

[OpenAPI Specification & Validation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets openapi.yaml / code-first generator / request/response validation middleware. Known failure pattern: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes..

## When to use it
Audit and harden "OpenAPI Specification & Validation". The common failure pattern "Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code." may be present. Follow the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Produce a risk-ranked list of findings.

## Protocol
You are hardening OpenAPI Specification & Validation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code.. Apply the best practice: Use code-first OpenAPI generation (FastAPI, NestJS swagger, or express-openapi) so the spec always reflects the actual routes.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific openapi.yaml / code-first generator / request/response validation middleware this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden OpenAPI Specification & Validation" — audit for Generating an OpenAPI spec that is out of sync with the actual implementation because the spec is maintained manually instead of generated from code and apply the best practice fix.
- "Secure OpenAPI Specification & Validation setup" — review openapi.yaml / code-first generator / request/response validation middleware and produce a risk-ranked list.
__USB_SKILL_4AC3FCD56FEDB915__

write_file "$PACK_DIR/skills/playwright-selectors-harden.md" <<'__USB_SKILL_6ADF25A40C6D5D28__'
---
description: "[Playwright Selectors & Locators] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture."
slug: playwright-selectors-harden
name: Playwright Selectors & Locators: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:playwright-selectors, workflow:harden, security, playwright, testing, e2e
---

# Playwright Selectors & Locators: Harden

[Playwright Selectors & Locators] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets locator refactor / test fixture / POM (Page Object Model) / custom fixture. Known failure pattern: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes..

## When to use it
Audit and harden "Playwright Selectors & Locators". The common failure pattern "Using fragile CSS selectors (nth-child, class names that change) that break on every UI update." may be present. Follow the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Playwright Selectors & Locators. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using fragile CSS selectors (nth-child, class names that change) that break on every UI update.. Apply the best practice: Use getByRole, getByText, or getByTestId with semantic naming. These are resilient to CSS and DOM structure changes.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific locator refactor / test fixture / POM (Page Object Model) / custom fixture this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Playwright Selectors & Locators" — audit for Using fragile CSS selectors (nth-child, class names that change) that break on every UI update and apply the best practice fix.
- "Secure Playwright Selectors & Locators setup" — review locator refactor / test fixture / POM (Page Object Model) / custom fixture and produce a risk-ranked list.
__USB_SKILL_6ADF25A40C6D5D28__

write_file "$PACK_DIR/skills/prompt-injection-defense-harden.md" <<'__USB_SKILL_C460FA607E407AA0__'
---
description: "[Prompt Injection Defense] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator."
slug: prompt-injection-defense-harden
name: Prompt Injection Defense: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:prompt-injection-defense, workflow:harden, security, prompt, llm
---

# Prompt Injection Defense: Harden

[Prompt Injection Defense] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets defensive system prompt / input sanitizer / instruction guardrail / output validator. Known failure pattern: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts..

## When to use it
Audit and harden "Prompt Injection Defense". The common failure pattern "Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'." may be present. Follow the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Prompt Injection Defense. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions'.. Apply the best practice: Isolate user input in a delimited section, use a separate 'input' variable, and add explicit guardrails that reject instruction override attempts.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific defensive system prompt / input sanitizer / instruction guardrail / output validator this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Prompt Injection Defense" — audit for Building a system prompt that includes user input directly without isolation, allowing users to override instructions by saying 'ignore previous instructions' and apply the best practice fix.
- "Secure Prompt Injection Defense setup" — review defensive system prompt / input sanitizer / instruction guardrail / output validator and produce a risk-ranked list.
__USB_SKILL_C460FA607E407AA0__

write_file "$PACK_DIR/skills/python-async-harden.md" <<'__USB_SKILL_139C84681FD267AF__'
---
description: "[Python Async/Await Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets async/await refactor / asyncio.gather / async context manager."
slug: python-async-harden
name: Python Async/Await Patterns: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:python-async, workflow:harden, security, python, async, performance
---

# Python Async/Await Patterns: Harden

[Python Async/Await Patterns] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets async/await refactor / asyncio.gather / async context manager. Known failure pattern: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function..

## When to use it
Audit and harden "Python Async/Await Patterns". The common failure pattern "Blocking the event loop by using synchronous requests or time.sleep inside async functions." may be present. Follow the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Python Async/Await Patterns. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Blocking the event loop by using synchronous requests or time.sleep inside async functions.. Apply the best practice: Use httpx.AsyncClient for HTTP calls and asyncio.sleep for delays inside async functions. Never mix sync and async I/O in the same function.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific async/await refactor / asyncio.gather / async context manager this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Python Async/Await Patterns" — audit for Blocking the event loop by using synchronous requests or time and apply the best practice fix.
- "Secure Python Async/Await Patterns setup" — review async/await refactor / asyncio.gather / async context manager and produce a risk-ranked list.
__USB_SKILL_139C84681FD267AF__

write_file "$PACK_DIR/skills/python-file-io-harden.md" <<'__USB_SKILL_97926B7262303153__'
---
description: "[Python File I/O & Encoding] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets pathlib refactor / encoding-safe file reader / batch file processor."
slug: python-file-io-harden
name: Python File I/O & Encoding: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:python-file-io, workflow:harden, security, python, file-io, scripting
---

# Python File I/O & Encoding: Harden

[Python File I/O & Encoding] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets pathlib refactor / encoding-safe file reader / batch file processor. Known failure pattern: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code..

## When to use it
Audit and harden "Python File I/O & Encoding". The common failure pattern "Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content." may be present. Follow the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Python File I/O & Encoding. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content.. Apply the best practice: Always specify encoding explicitly when opening text files. Use pathlib.Path.read_text/write_bytes for cleaner code.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific pathlib refactor / encoding-safe file reader / batch file processor this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Python File I/O & Encoding" — audit for Opening binary files in text mode or assuming UTF-8 encoding, leading to UnicodeDecodeError on non-ASCII content and apply the best practice fix.
- "Secure Python File I/O & Encoding setup" — review pathlib refactor / encoding-safe file reader / batch file processor and produce a risk-ranked list.
__USB_SKILL_97926B7262303153__

write_file "$PACK_DIR/skills/rag-chunking-harden.md" <<'__USB_SKILL_68BDA0D6BCBF9E5C__'
---
description: "[RAG Chunking Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment."
slug: rag-chunking-harden
name: RAG Chunking Strategies: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:rag-chunking, workflow:harden, security, rag, chunking, retrieval
---

# RAG Chunking Strategies: Harden

[RAG Chunking Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment. Known failure pattern: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries..

## When to use it
Audit and harden "RAG Chunking Strategies". The common failure pattern "Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality." may be present. Follow the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Produce a risk-ranked list of findings.

## Protocol
You are hardening RAG Chunking Strategies. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality.. Apply the best practice: Use semantic chunking: split on paragraph boundaries, markdown headings, or code function boundaries. Overlap adjacent chunks by 10-20% to avoid missing context near boundaries.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden RAG Chunking Strategies" — audit for Using fixed-size chunking (500 characters) that splits sentences or code blocks in half, reducing retrieval quality and apply the best practice fix.
- "Secure RAG Chunking Strategies setup" — review semantic chunker / chunk overlap config / hybrid retriever / chunk metadata enrichment and produce a risk-ranked list.
__USB_SKILL_68BDA0D6BCBF9E5C__

write_file "$PACK_DIR/skills/rate-limiting-proxy-harden.md" <<'__USB_SKILL_B2CD51FEC0331D3B__'
---
description: "[Rate Limiting & API Gateway Proxy] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation."
slug: rate-limiting-proxy-harden
name: Rate Limiting & API Gateway Proxy: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:rate-limiting-proxy, workflow:harden, security, rate-limiting, proxy
---

# Rate Limiting & API Gateway Proxy: Harden

[Rate Limiting & API Gateway Proxy] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation. Known failure pattern: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server..

## When to use it
Audit and harden "Rate Limiting & API Gateway Proxy". The common failure pattern "Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources." may be present. Follow the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Rate Limiting & API Gateway Proxy. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources.. Apply the best practice: Enforce rate limits at the reverse proxy level (NGINX, Cloudflare, API Gateway) before the request reaches your application server.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Rate Limiting & API Gateway Proxy" — audit for Applying rate limiting at the application level without a proxy layer, so rate-limited requests still consume application server resources and apply the best practice fix.
- "Secure Rate Limiting & API Gateway Proxy setup" — review NGINX rate limit config / Cloudflare WAF rule / API Gateway usage plan / token bucket implementation and produce a risk-ranked list.
__USB_SKILL_B2CD51FEC0331D3B__

write_file "$PACK_DIR/skills/react-server-components-harden.md" <<'__USB_SKILL_D23B066F1B9ACB54__'
---
description: "[React Server Components] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets server component / client boundary refactor / streaming fallback."
slug: react-server-components-harden
name: React Server Components: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:react-server-components, workflow:harden, security, react, rsc, frontend
---

# React Server Components: Harden

[React Server Components] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets server component / client boundary refactor / streaming fallback. Known failure pattern: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands..

## When to use it
Audit and harden "React Server Components". The common failure pattern "Accidentally making a server component a client component by using hooks or event handlers in the wrong file." may be present. Follow the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Produce a risk-ranked list of findings.

## Protocol
You are hardening React Server Components. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Accidentally making a server component a client component by using hooks or event handlers in the wrong file.. Apply the best practice: Keep data fetching and heavy logic in server components; pass results as props to client islands.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific server component / client boundary refactor / streaming fallback this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden React Server Components" — audit for Accidentally making a server component a client component by using hooks or event handlers in the wrong file and apply the best practice fix.
- "Secure React Server Components setup" — review server component / client boundary refactor / streaming fallback and produce a risk-ranked list.
__USB_SKILL_D23B066F1B9ACB54__

write_file "$PACK_DIR/skills/react-state-harden.md" <<'__USB_SKILL_97A6ED5F61D8C1F0__'
---
description: "[React State Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice."
slug: react-state-harden
name: React State Management: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:react-state, workflow:harden, security, react, state, frontend
---

# React State Management: Harden

[React State Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets useState / useReducer / useContext hook refactor, zustand or jotai store slice. Known failure pattern: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it..

## When to use it
Audit and harden "React State Management". The common failure pattern "Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation." may be present. Follow the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Produce a risk-ranked list of findings.

## Protocol
You are hardening React State Management. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation.. Apply the best practice: Co-locate state as close to the consuming component as possible. Lift state only when two or more siblings need to share it.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific useState / useReducer / useContext hook refactor, zustand or jotai store slice this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden React State Management" — audit for Stale closures or unnecessary re-renders caused by missing dependency arrays or incorrect state initialisation and apply the best practice fix.
- "Secure React State Management setup" — review useState / useReducer / useContext hook refactor, zustand or jotai store slice and produce a risk-ranked list.
__USB_SKILL_97A6ED5F61D8C1F0__

write_file "$PACK_DIR/skills/redis-caching-harden.md" <<'__USB_SKILL_2C75B5494CDB8857__'
---
description: "[Redis Caching Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy."
slug: redis-caching-harden
name: Redis Caching Strategies: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:redis-caching, workflow:harden, security, redis, caching, performance
---

# Redis Caching Strategies: Harden

[Redis Caching Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets cache wrapper / mutex lock / stale-while-revalidate / TTL policy. Known failure pattern: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed..

## When to use it
Audit and harden "Redis Caching Strategies". The common failure pattern "Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time." may be present. Follow the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Redis Caching Strategies. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time.. Apply the best practice: Use a mutex lock around cache regeneration, or stale-while-revalidate pattern to serve stale data while the new value is being computed.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cache wrapper / mutex lock / stale-while-revalidate / TTL policy this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Redis Caching Strategies" — audit for Cache stampede: multiple requests simultaneously recomputing an expired cache entry because they all detected expiry at the same time and apply the best practice fix.
- "Secure Redis Caching Strategies setup" — review cache wrapper / mutex lock / stale-while-revalidate / TTL policy and produce a risk-ranked list.
__USB_SKILL_2C75B5494CDB8857__

write_file "$PACK_DIR/skills/rest-pagination-harden.md" <<'__USB_SKILL_1A01DBBE44B20249__'
---
description: "[REST Pagination Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope."
slug: rest-pagination-harden
name: REST Pagination Design: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:rest-pagination, workflow:harden, security, rest, pagination, api
---

# REST Pagination Design: Harden

[REST Pagination Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets cursor pagination / offset pagination fallback / total count optimisation / response envelope. Known failure pattern: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value..

## When to use it
Audit and harden "REST Pagination Design". The common failure pattern "Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows." may be present. Follow the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Produce a risk-ranked list of findings.

## Protocol
You are hardening REST Pagination Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows.. Apply the best practice: Use cursor-based pagination (keyset pagination) for large datasets. The cursor is an opaque token that points to the last item, and the DB query uses WHERE > cursor_value.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific cursor pagination / offset pagination fallback / total count optimisation / response envelope this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden REST Pagination Design" — audit for Using offset-based pagination with large offsets ('?offset=10000') that causes slow database queries because the DB has to scan and skip many rows and apply the best practice fix.
- "Secure REST Pagination Design setup" — review cursor pagination / offset pagination fallback / total count optimisation / response envelope and produce a risk-ranked list.
__USB_SKILL_1A01DBBE44B20249__

write_file "$PACK_DIR/skills/secrets-rotation-harden.md" <<'__USB_SKILL_E8173C2E76EE7875__'
---
description: "[Secrets Rotation Policy] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets rotation script / vault integration / lease management / incident response plan."
slug: secrets-rotation-harden
name: Secrets Rotation Policy: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:secrets-rotation, workflow:harden, security, secrets, rotation
---

# Secrets Rotation Policy: Harden

[Secrets Rotation Policy] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets rotation script / vault integration / lease management / incident response plan. Known failure pattern: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files..

## When to use it
Audit and harden "Secrets Rotation Policy". The common failure pattern "Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak." may be present. Follow the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Secrets Rotation Policy. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak.. Apply the best practice: Automate secret rotation with a scheduled job. Use short-lived tokens (e.g., 90 days) and rotate them before expiry. Store secrets in a vault, not in env files.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific rotation script / vault integration / lease management / incident response plan this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Secrets Rotation Policy" — audit for Using long-lived API keys and secrets that never expire, increasing the blast radius if they leak and apply the best practice fix.
- "Secure Secrets Rotation Policy setup" — review rotation script / vault integration / lease management / incident response plan and produce a risk-ranked list.
__USB_SKILL_E8173C2E76EE7875__

write_file "$PACK_DIR/skills/shell-script-robustness-harden.md" <<'__USB_SKILL_D748EAE972832675__'
---
description: "[Shell Script Robustness & Safety] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function."
slug: shell-script-robustness-harden
name: Shell Script Robustness & Safety: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:shell-script-robustness, workflow:harden, security, shell, scripting, safety
---

# Shell Script Robustness & Safety: Harden

[Shell Script Robustness & Safety] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function. Known failure pattern: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script..

## When to use it
Audit and harden "Shell Script Robustness & Safety". The common failure pattern "Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage." may be present. Follow the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Shell Script Robustness & Safety. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage.. Apply the best practice: Always start scripts with 'set -euo pipefail'. Add confirmation prompts before destructive operations. Use shellcheck to lint the script.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Shell Script Robustness & Safety" — audit for Shell scripts that fail silently midway because 'set -e' is not set, or that modify files without confirmation, causing irreversible damage and apply the best practice fix.
- "Secure Shell Script Robustness & Safety setup" — review set -euo pipefail script / confirmation prompt / shellcheck-passing script / rollback function and produce a risk-ranked list.
__USB_SKILL_D748EAE972832675__

write_file "$PACK_DIR/skills/sql-query-optimization-harden.md" <<'__USB_SKILL_0F280A16532EE985__'
---
description: "[SQL Query Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index."
slug: sql-query-optimization-harden
name: SQL Query Optimisation: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:sql-query-optimization, workflow:harden, security, sql, optimization, database
---

# SQL Query Optimisation: Harden

[SQL Query Optimisation] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets indexed query / composite index / EXPLAIN ANALYSE plan / partial index. Known failure pattern: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly..

## When to use it
Audit and harden "SQL Query Optimisation". The common failure pattern "Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs." may be present. Follow the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Produce a risk-ranked list of findings.

## Protocol
You are hardening SQL Query Optimisation. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs.. Apply the best practice: Always select only the columns you need. Add composite indexes that match your WHERE + ORDER BY clauses exactly.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific indexed query / composite index / EXPLAIN ANALYSE plan / partial index this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden SQL Query Optimisation" — audit for Using SELECT * in production queries and missing indexes on foreign key columns used in JOINs and apply the best practice fix.
- "Secure SQL Query Optimisation setup" — review indexed query / composite index / EXPLAIN ANALYSE plan / partial index and produce a risk-ranked list.
__USB_SKILL_0F280A16532EE985__

write_file "$PACK_DIR/skills/stealth-web-research-harden.md" <<'__USB_SKILL_998A183FB6327119__'
---
description: "[Stealth Web Research & Harvesting] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages."
slug: stealth-web-research-harden
name: Stealth Web Research & Harvesting: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:stealth-web-research, workflow:harden, security, stealth, scraping, research, anti-bot
---

# Stealth Web Research & Harvesting: Harden

[Stealth Web Research & Harvesting] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages. Known failure pattern: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers..

## When to use it
Audit and harden "Stealth Web Research & Harvesting". The common failure pattern "Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests." may be present. Follow the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Stealth Web Research & Harvesting. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests.. Apply the best practice: Use stealth-augmented browser automation (playwright-extra + stealth or puppeteer-extra + stealth plugin). Rotate realistic user agents with referrer headers. Add 1.5-3 second random delays between navigations. Respect robots.txt and rate-limit headers.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Stealth Web Research & Harvesting" — audit for Web scrapers getting blocked by Cloudflare, Akamai, or DataDome bot detection because they send no user-agent, use headless Chromium without stealth plugins, or hammer endpoints with zero delays between requests and apply the best practice fix.
- "Secure Stealth Web Research & Harvesting setup" — review clean markdown corpus / structured JSON metadata / per-page extraction report / sitemap of crawled pages and produce a risk-ranked list.
__USB_SKILL_998A183FB6327119__

write_file "$PACK_DIR/skills/stripe-webhook-idempotency-harden.md" <<'__USB_SKILL_AAAC964644A24254__'
---
description: "[Stripe Webhook Idempotency] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery."
slug: stripe-webhook-idempotency-harden
name: Stripe Webhook Idempotency: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:stripe-webhook-idempotency, workflow:harden, security, stripe, webhook, payments
---

# Stripe Webhook Idempotency: Harden

[Stripe Webhook Idempotency] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets Webhook handler / idempotency key check / event deduplication / failed payment recovery. Known failure pattern: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events..

## When to use it
Audit and harden "Stripe Webhook Idempotency". The common failure pattern "Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations." may be present. Follow the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Stripe Webhook Idempotency. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations.. Apply the best practice: Use the Stripe-Idempotency-Key or the event ID as a unique constraint in your database to skip already-processed events.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific Webhook handler / idempotency key check / event deduplication / failed payment recovery this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Stripe Webhook Idempotency" — audit for Processing the same Stripe webhook event twice because Stripe sends at-least-once delivery, causing duplicate charges or duplicate subscription activations and apply the best practice fix.
- "Secure Stripe Webhook Idempotency setup" — review Webhook handler / idempotency key check / event deduplication / failed payment recovery and produce a risk-ranked list.
__USB_SKILL_AAAC964644A24254__

write_file "$PACK_DIR/skills/supabase-rls-harden.md" <<'__USB_SKILL_46F8B28B0625B109__'
---
description: "[Supabase Row-Level Security] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets RLS policy / policy test / security definer function / admin bypass."
slug: supabase-rls-harden
name: Supabase Row-Level Security: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:supabase-rls, workflow:harden, security, supabase, rls
---

# Supabase Row-Level Security: Harden

[Supabase Row-Level Security] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets RLS policy / policy test / security definer function / admin bypass. Known failure pattern: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production..

## When to use it
Audit and harden "Supabase Row-Level Security". The common failure pattern "RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data." may be present. Follow the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Supabase Row-Level Security. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: RLS policies that are too permissive (using 'true' instead of 'auth.uid() = user_id') accidentally exposing other users' data.. Apply the best practice: Always reference auth.uid() in RLS policies. Test policies with a non-admin user before deploying to production.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific RLS policy / policy test / security definer function / admin bypass this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Supabase Row-Level Security" — audit for RLS policies that are too permissive (using 'true' instead of 'auth and apply the best practice fix.
- "Secure Supabase Row-Level Security setup" — review RLS policy / policy test / security definer function / admin bypass and produce a risk-ranked list.
__USB_SKILL_46F8B28B0625B109__

write_file "$PACK_DIR/skills/terraform-state-harden.md" <<'__USB_SKILL_1B1B20DA6AF6C110__'
---
description: "[Terraform State Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets backend config / state migration plan / state locking config / remote state datasource."
slug: terraform-state-harden
name: Terraform State Management: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:terraform-state, workflow:harden, security, terraform, state, iac
---

# Terraform State Management: Harden

[Terraform State Management] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets backend config / state migration plan / state locking config / remote state datasource. Known failure pattern: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent..

## When to use it
Audit and harden "Terraform State Management". The common failure pattern "Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure." may be present. Follow the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Terraform State Management. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Losing the .tfstate file (or it becoming corrupted), forcing manual reconstruction of the entire infrastructure.. Apply the best practice: Always store state in a remote backend (S3, Azure Storage, Terraform Cloud) with state locking enabled via DynamoDB or equivalent.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific backend config / state migration plan / state locking config / remote state datasource this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Terraform State Management" — audit for Losing the  and apply the best practice fix.
- "Secure Terraform State Management setup" — review backend config / state migration plan / state locking config / remote state datasource and produce a risk-ranked list.
__USB_SKILL_1B1B20DA6AF6C110__

write_file "$PACK_DIR/skills/typescript-generics-harden.md" <<'__USB_SKILL_68BCC3E83F8FFE3C__'
---
description: "[TypeScript Generics & Advanced Types] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets generic type / conditional type / mapped type / branded type."
slug: typescript-generics-harden
name: TypeScript Generics & Advanced Types: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:typescript-generics, workflow:harden, security, typescript, generics, type-system
---

# TypeScript Generics & Advanced Types: Harden

[TypeScript Generics & Advanced Types] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets generic type / conditional type / mapped type / branded type. Known failure pattern: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property..

## When to use it
Audit and harden "TypeScript Generics & Advanced Types". The common failure pattern "Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice)." may be present. Follow the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Produce a risk-ranked list of findings.

## Protocol
You are hardening TypeScript Generics & Advanced Types. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice).. Apply the best practice: Prefer generic constraints that describe the minimum required structure (extends) rather than listing every possible property.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific generic type / conditional type / mapped type / branded type this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden TypeScript Generics & Advanced Types" — audit for Generic constraints that are too loose (accepting anything) or too tight (requiring exact shapes when interfaces would suffice) and apply the best practice fix.
- "Secure TypeScript Generics & Advanced Types setup" — review generic type / conditional type / mapped type / branded type and produce a risk-ranked list.
__USB_SKILL_68BCC3E83F8FFE3C__

write_file "$PACK_DIR/skills/user-onboarding-flow-harden.md" <<'__USB_SKILL_89912BAE65B163CC__'
---
description: "[User Onboarding Flow Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec."
slug: user-onboarding-flow-harden
name: User Onboarding Flow Design: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:user-onboarding-flow, workflow:harden, security, ux, onboarding, product
---

# User Onboarding Flow Design: Harden

[User Onboarding Flow Design] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets onboarding wizard / feature checklist / in-app guide / first-run experience spec. Known failure pattern: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal..

## When to use it
Audit and harden "User Onboarding Flow Design". The common failure pattern "Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value." may be present. Follow the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Produce a risk-ranked list of findings.

## Protocol
You are hardening User Onboarding Flow Design. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value.. Apply the best practice: Use progressive disclosure: only introduce features when the user reaches the point where they need them. A 3-step wizard that gets them to the 'aha moment' in under 60 seconds is ideal.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific onboarding wizard / feature checklist / in-app guide / first-run experience spec this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden User Onboarding Flow Design" — audit for Showing the user a long tutorial or feature list on first login, overwhelming them and causing the majority to leave before experiencing core value and apply the best practice fix.
- "Secure User Onboarding Flow Design setup" — review onboarding wizard / feature checklist / in-app guide / first-run experience spec and produce a risk-ranked list.
__USB_SKILL_89912BAE65B163CC__

write_file "$PACK_DIR/skills/vercel-env-vars-harden.md" <<'__USB_SKILL_F3BC1C1326FF8A7D__'
---
description: "[Vercel Environment Variables] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets vercel.json env group / preview env config / Edge Config / KV store."
slug: vercel-env-vars-harden
name: Vercel Environment Variables: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:vercel-env-vars, workflow:harden, security, vercel, env, deployment
---

# Vercel Environment Variables: Harden

[Vercel Environment Variables] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets vercel.json env group / preview env config / Edge Config / KV store. Known failure pattern: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'..

## When to use it
Audit and harden "Vercel Environment Variables". The common failure pattern "Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments." may be present. Follow the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Vercel Environment Variables. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments.. Apply the best practice: Use separate environment groups for production, preview, and development. Never mark sensitive keys as 'available to all branches'.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific vercel.json env group / preview env config / Edge Config / KV store this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Vercel Environment Variables" — audit for Accidentally exposing preview URLs or internal API keys by adding them as preview environment variables that get picked up by branch deployments and apply the best practice fix.
- "Secure Vercel Environment Variables setup" — review vercel.json env group / preview env config / Edge Config / KV store and produce a risk-ranked list.
__USB_SKILL_F3BC1C1326FF8A7D__

write_file "$PACK_DIR/skills/web-scraping-ethics-harden.md" <<'__USB_SKILL_7CB9BAC3556D9588__'
---
description: "[Web Scraping Ethics & Compliance] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper."
slug: web-scraping-ethics-harden
name: Web Scraping Ethics & Compliance: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:web-scraping-ethics, workflow:harden, security, scraping, ethics, research
---

# Web Scraping Ethics & Compliance: Harden

[Web Scraping Ethics & Compliance] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets robots.txt check / polite scraper / rate-limited crawler / cached scraper. Known failure pattern: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information..

## When to use it
Audit and harden "Web Scraping Ethics & Compliance". The common failure pattern "Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues." may be present. Follow the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Web Scraping Ethics & Compliance. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Scraping a website that explicitly prohibits it in robots.txt or terms of service, leading to legal or IP blocking issues.. Apply the best practice: Always check robots.txt and terms of service before scraping. Respect Crawl-Delay directives and set a reasonable User-Agent with contact information.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific robots.txt check / polite scraper / rate-limited crawler / cached scraper this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Web Scraping Ethics & Compliance" — audit for Scraping a website that explicitly prohibits it in robots and apply the best practice fix.
- "Secure Web Scraping Ethics & Compliance setup" — review robots.txt check / polite scraper / rate-limited crawler / cached scraper and produce a risk-ranked list.
__USB_SKILL_7CB9BAC3556D9588__

write_file "$PACK_DIR/skills/websocket-reconnection-harden.md" <<'__USB_SKILL_8954744358243019__'
---
description: "[WebSocket Reconnection Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets WebSocket client / reconnection logic / heartbeat / connection status component."
slug: websocket-reconnection-harden
name: WebSocket Reconnection Strategies: Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:websocket-reconnection, workflow:harden, security, websocket, realtime, frontend
---

# WebSocket Reconnection Strategies: Harden

[WebSocket Reconnection Strategies] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets WebSocket client / reconnection logic / heartbeat / connection status component. Known failure pattern: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI..

## When to use it
Audit and harden "WebSocket Reconnection Strategies". The common failure pattern "Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state." may be present. Follow the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Produce a risk-ranked list of findings.

## Protocol
You are hardening WebSocket Reconnection Strategies. Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state.. Apply the best practice: Implement exponential backoff reconnection with a maximum delay of 30 seconds. Show a connection status indicator in the UI.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific WebSocket client / reconnection logic / heartbeat / connection status component this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden WebSocket Reconnection Strategies" — audit for Losing real-time updates when the WebSocket disconnects temporarily, and not attempting to reconnect, leaving the UI in a stale state and apply the best practice fix.
- "Secure WebSocket Reconnection Strategies setup" — review WebSocket client / reconnection logic / heartbeat / connection status component and produce a risk-ranked list.
__USB_SKILL_8954744358243019__

write_file "$PACK_DIR/skills/web-vitals-optimization-harden.md" <<'__USB_SKILL_5085349E0CFCE3EE__'
---
description: "[Web Vitals Optimisation (LCP/CLS/INP)] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis."
slug: web-vitals-optimization-harden
name: Web Vitals Optimisation (LCP/CLS/INP): Harden
category: Security
risk: high
model_agnostic: true
agent_agnostic: true
tags: target:web-vitals-optimization, workflow:harden, security, performance, web-vitals, optimisation
---

# Web Vitals Optimisation (LCP/CLS/INP): Harden

[Web Vitals Optimisation (LCP/CLS/INP)] Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary. Targets image optimisation / font display swap / critical CSS / lazy load / bundle analysis. Known failure pattern: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation..

## When to use it
Audit and harden "Web Vitals Optimisation (LCP/CLS/INP)". The common failure pattern "Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions)." may be present. Follow the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Produce a risk-ranked list of findings.

## Protocol
You are hardening Web Vitals Optimisation (LCP/CLS/INP). Improve security, resilience, or reliability. Audit for exposed secrets, missing input validation, inadequate error handling, or weak access controls. Apply fixes that do not change the public API surface unless absolutely necessary.. Check for: Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions).. Apply the best practice: Serve images in WebP/AVIF format, specify width and height to reserve space (prevent CLS), and lazy-load below-the-fold images. Use next/image for automatic optimisation.. Rank findings by severity.

## Input contract
- **goal** (text, required): The precise outcome the user wants to achieve.
- **context** (text, optional): Project, file, conversation or task context.
- **assets** (text, optional): Relevant code, logs, URLs, documents or data samples.
- **domainArtifact** (text, optional): The specific image optimisation / font display swap / critical CSS / lazy load / bundle analysis this task involves.

## Output contract
- **manifest** (json): Machine-readable plan, contract or registry output.
- **checklist** (checklist): Executable steps with risk assessment and validation items.

## Examples
- "Harden Web Vitals Optimisation (LCP/CLS/INP)" — audit for Large LCP caused by a hero image that is larger than needed and not optimised (WebP, lazy loading, proper dimensions) and apply the best practice fix.
- "Secure Web Vitals Optimisation (LCP/CLS/INP) setup" — review image optimisation / font display swap / critical CSS / lazy load / bundle analysis and produce a risk-ranked list.
__USB_SKILL_5085349E0CFCE3EE__

case "$TARGET" in
  leosis)
    DEST="${LEOSIS_SKILLS_DIR:-$HOME/.leosis/skills/$PACK_SLUG}"
    do_or_show mkdir -p "$DEST"
    do_or_show cp "$PACK_DIR/skills/"*.md "$DEST/"
    do_or_show cp "$PACK_DIR/skillpack.json" "$DEST/skillpack.json"
    do_or_show cp "$PACK_DIR/adapter.bridge.json" "$DEST/adapter.bridge.json"
    do_or_show cp "$PACK_DIR/cursor-rule.mdc" "$DEST/$PACK_SLUG.mdc"
    ;;
  claude)
    # Claude Code discovers skills as <skill-name>/SKILL.md directories, not
    # as loose .md files — dropping the pack in as flat markdown wrote real
    # files that Claude then silently ignored.
    DEST="${CLAUDE_SKILLS_DIR:-$HOME/.claude/skills}"
    do_or_show mkdir -p "$DEST"
    if [ "$SKILL_COUNT" -le 10 ]; then
      # A handful: each becomes its own directly-invocable /<slug> skill.
      for __usb_src in "$PACK_DIR/skills/"*.md; do
        __usb_slug=$(basename "$__usb_src" .md)
        do_or_show mkdir -p "$DEST/$__usb_slug"
        do_or_show cp "$__usb_src" "$DEST/$__usb_slug/SKILL.md"
      done
      unset __usb_src __usb_slug
    else
      # A catalog: one /usb router skill, with the skills beside it as
      # reference files. Claude loads every skill's description up front to
      # choose between them, so N directories would mean N descriptions in
      # context on every request; a skill's body costs nothing until used.
      do_or_show mkdir -p "$DEST/usb/skills"
      do_or_show cp "$PACK_DIR/skills/"*.md "$DEST/usb/skills/"
      do_or_show cp "$PACK_DIR/skillpack.json" "$DEST/usb/skillpack.json"
write_file "$DEST/usb/SKILL.md" <<'__USB_CLAUDE_ROUTER_A3F6F4A23FAFE2C8__'
---
description: "Universal Skill Bridge Catalog: 529 engineering skills across 14 categories. Use when the user wants to audit, plan, build, script, diagnose, harden, explain, or tune a specific technology — databases, infrastructure, frontend, security, AI agents, and more."
---

# Universal Skill Bridge Catalog

529 skills are installed as reference files in `skills/` next to this file.
Each one carries a full protocol, input and output contracts, and worked examples.

## How to use this

1. Work out what the user is asking for: the technology involved, and the kind
   of work — audit, plan, build, script, diagnose, harden, explain, or tune.
2. Find the matching slug in the index below. Generated skills are named
   `<domain>-<workflow>`, for example `redis-caching-harden`.
3. Read `skills/<slug>.md` and follow its Protocol section.
4. If nothing matches closely, say so and proceed normally rather than forcing
   an unrelated skill.

## Index

### Audit
a-b-testing-framework-audit, a11y-aria-patterns-audit, adr-documentation-audit, agent-tool-binding-audit, analytics-metric-definition-audit, aws-lambda-cold-start-audit, azure-bicep-audit, browser-devtools-audit, cli-tool-design-audit, cloud-cost-optimization-audit, code-review-checklist-audit, context-window-budget-audit, convex-functions-audit, cron-job-reliability-audit, css-layout-audit, csv-data-cleaning-audit, data-warehouse-schema-audit, database-migration-safety-audit, design-token-system-audit, docker-compose-networking-audit, docker-multistage-audit, drizzle-schema-design-audit, error-monitoring-setup-audit, fastapi-dependencies-audit, feature-flags-audit, git-conflict-resolution-audit, github-actions-pipeline-audit, graphql-n-plus-one-audit, jest-test-optimization-audit, json-schema-validation-audit, kubernetes-hpa-audit, kubernetes-pod-lifecycle-audit, mcp-tool-design-audit, message-queues-audit, multi-tenant-isolation-audit, nextjs-api-routes-audit, nextjs-data-fetching-audit, nextjs-middleware-audit, node-error-handling-audit, node-streams-audit, oauth-flows-audit, openapi-spec-audit, playwright-selectors-audit, prompt-injection-defense-audit, python-async-audit, python-file-io-audit, rag-chunking-audit, rate-limiting-proxy-audit, react-server-components-audit, react-state-audit, redis-caching-audit, rest-pagination-audit, secrets-rotation-audit, shell-script-robustness-audit, sql-query-optimization-audit, stealth-web-research-audit, stripe-webhook-idempotency-audit, supabase-rls-audit, terraform-state-audit, typescript-generics-audit, user-onboarding-flow-audit, vercel-env-vars-audit, web-scraping-ethics-audit, web-vitals-optimization-audit, websocket-reconnection-audit

### Automation
a-b-testing-framework-script, a11y-aria-patterns-script, adr-documentation-script, agent-tool-binding-script, analytics-metric-definition-script, aws-lambda-cold-start-script, azure-bicep-script, browser-devtools-script, cli-tool-design-script, cloud-cost-optimization-script, code-review-checklist-script, context-window-budget-script, convex-functions-script, cron-job-reliability-script, css-layout-script, csv-data-cleaning-script, data-warehouse-schema-script, database-migration-safety-script, design-token-system-script, docker-compose-networking-script, docker-multistage-script, drizzle-schema-design-script, error-monitoring-setup-script, fastapi-dependencies-script, feature-flags-script, git-conflict-resolution-script, github-actions-pipeline-script, graphql-n-plus-one-script, jest-test-optimization-script, json-schema-validation-script, kubernetes-hpa-script, kubernetes-pod-lifecycle-script, mcp-tool-design-script, message-queues-script, multi-tenant-isolation-script, nextjs-api-routes-script, nextjs-data-fetching-script, nextjs-middleware-script, node-error-handling-script, node-streams-script, oauth-flows-script, openapi-spec-script, playwright-selectors-script, prompt-injection-defense-script, python-async-script, python-file-io-script, rag-chunking-script, rate-limiting-proxy-script, react-server-components-script, react-state-script, redis-caching-script, rest-pagination-script, secrets-rotation-script, shell-script-robustness-script, sql-query-optimization-script, stealth-web-research-script, stripe-webhook-idempotency-script, supabase-rls-script, terraform-state-script, typescript-generics-script, user-onboarding-flow-script, vercel-env-vars-script, web-scraping-ethics-script, web-vitals-optimization-script, websocket-reconnection-script

### Context
memory-compressor

### Diagnostics
a-b-testing-framework-diagnose, a11y-aria-patterns-diagnose, adr-documentation-diagnose, agent-tool-binding-diagnose, analytics-metric-definition-diagnose, aws-lambda-cold-start-diagnose, azure-bicep-diagnose, browser-devtools-diagnose, cli-tool-design-diagnose, cloud-cost-optimization-diagnose, code-review-checklist-diagnose, context-window-budget-diagnose, convex-functions-diagnose, cron-job-reliability-diagnose, css-layout-diagnose, csv-data-cleaning-diagnose, data-warehouse-schema-diagnose, database-migration-safety-diagnose, design-token-system-diagnose, docker-compose-networking-diagnose, docker-multistage-diagnose, drizzle-schema-design-diagnose, error-monitoring-setup-diagnose, fastapi-dependencies-diagnose, feature-flags-diagnose, git-conflict-resolution-diagnose, github-actions-pipeline-diagnose, graphql-n-plus-one-diagnose, jest-test-optimization-diagnose, json-schema-validation-diagnose, kubernetes-hpa-diagnose, kubernetes-pod-lifecycle-diagnose, mcp-tool-design-diagnose, message-queues-diagnose, multi-tenant-isolation-diagnose, nextjs-api-routes-diagnose, nextjs-data-fetching-diagnose, nextjs-middleware-diagnose, node-error-handling-diagnose, node-streams-diagnose, oauth-flows-diagnose, openapi-spec-diagnose, playwright-selectors-diagnose, prompt-injection-defense-diagnose, python-async-diagnose, python-file-io-diagnose, rag-chunking-diagnose, rate-limiting-proxy-diagnose, react-server-components-diagnose, react-state-diagnose, redis-caching-diagnose, rest-pagination-diagnose, secrets-rotation-diagnose, shell-script-robustness-diagnose, sql-query-optimization-diagnose, stealth-web-research-diagnose, stripe-webhook-idempotency-diagnose, supabase-rls-diagnose, terraform-state-diagnose, typescript-generics-diagnose, user-onboarding-flow-diagnose, vercel-env-vars-diagnose, web-scraping-ethics-diagnose, web-vitals-optimization-diagnose, websocket-reconnection-diagnose

### Docs
a-b-testing-framework-explain, a11y-aria-patterns-explain, adr-documentation-explain, agent-tool-binding-explain, analytics-metric-definition-explain, aws-lambda-cold-start-explain, azure-bicep-explain, browser-devtools-explain, cli-tool-design-explain, cloud-cost-optimization-explain, code-review-checklist-explain, convex-functions-explain, cron-job-reliability-explain, css-layout-explain, csv-data-cleaning-explain, data-warehouse-schema-explain, database-migration-safety-explain, design-token-system-explain, docker-compose-networking-explain, docker-multistage-explain, drizzle-schema-design-explain, error-monitoring-setup-explain, fastapi-dependencies-explain, feature-flags-explain, git-conflict-resolution-explain, github-actions-pipeline-explain, graphql-n-plus-one-explain, jest-test-optimization-explain, json-schema-validation-explain, kubernetes-hpa-explain, kubernetes-pod-lifecycle-explain, mcp-tool-design-explain, message-queues-explain, multi-tenant-isolation-explain, nextjs-api-routes-explain, nextjs-data-fetching-explain, nextjs-middleware-explain, node-error-handling-explain, node-streams-explain, oauth-flows-explain, openapi-spec-explain, playwright-selectors-explain, prompt-injection-defense-explain, python-async-explain, python-file-io-explain, rag-chunking-explain, rate-limiting-proxy-explain, react-server-components-explain, react-state-explain, redis-caching-explain, rest-pagination-explain, secrets-rotation-explain, shell-script-robustness-explain, sql-query-optimization-explain, stealth-web-research-explain, stripe-webhook-idempotency-explain, supabase-rls-explain, terraform-state-explain, typescript-generics-explain, user-onboarding-flow-explain, vercel-env-vars-explain, web-scraping-ethics-explain, web-vitals-optimization-explain, websocket-reconnection-explain

### Documentation
context-window-budget-explain

### Engineering
codebase-navigator, implementation-sprint

### Implementation
a-b-testing-framework-build, a11y-aria-patterns-build, adr-documentation-build, agent-tool-binding-build, analytics-metric-definition-build, aws-lambda-cold-start-build, azure-bicep-build, browser-devtools-build, cli-tool-design-build, cloud-cost-optimization-build, code-review-checklist-build, context-window-budget-build, convex-functions-build, cron-job-reliability-build, css-layout-build, csv-data-cleaning-build, data-warehouse-schema-build, database-migration-safety-build, design-token-system-build, docker-compose-networking-build, docker-multistage-build, drizzle-schema-design-build, error-monitoring-setup-build, fastapi-dependencies-build, feature-flags-build, git-conflict-resolution-build, github-actions-pipeline-build, graphql-n-plus-one-build, jest-test-optimization-build, json-schema-validation-build, kubernetes-hpa-build, kubernetes-pod-lifecycle-build, mcp-tool-design-build, message-queues-build, multi-tenant-isolation-build, nextjs-api-routes-build, nextjs-data-fetching-build, nextjs-middleware-build, node-error-handling-build, node-streams-build, oauth-flows-build, openapi-spec-build, playwright-selectors-build, prompt-injection-defense-build, python-async-build, python-file-io-build, rag-chunking-build, rate-limiting-proxy-build, react-server-components-build, react-state-build, redis-caching-build, rest-pagination-build, secrets-rotation-build, shell-script-robustness-build, sql-query-optimization-build, stealth-web-research-build, stripe-webhook-idempotency-build, supabase-rls-build, terraform-state-build, typescript-generics-build, user-onboarding-flow-build, vercel-env-vars-build, web-scraping-ethics-build, web-vitals-optimization-build, websocket-reconnection-build

### Integration
adapter-smith, api-contract-smith

### Optimization
a-b-testing-framework-tune, a11y-aria-patterns-tune, adr-documentation-tune, agent-tool-binding-tune, analytics-metric-definition-tune, aws-lambda-cold-start-tune, azure-bicep-tune, browser-devtools-tune, cli-tool-design-tune, cloud-cost-optimization-tune, code-review-checklist-tune, context-window-budget-tune, convex-functions-tune, cron-job-reliability-tune, css-layout-tune, csv-data-cleaning-tune, data-warehouse-schema-tune, database-migration-safety-tune, design-token-system-tune, docker-compose-networking-tune, docker-multistage-tune, drizzle-schema-design-tune, error-monitoring-setup-tune, fastapi-dependencies-tune, feature-flags-tune, git-conflict-resolution-tune, github-actions-pipeline-tune, graphql-n-plus-one-tune, jest-test-optimization-tune, json-schema-validation-tune, kubernetes-hpa-tune, kubernetes-pod-lifecycle-tune, mcp-tool-design-tune, message-queues-tune, multi-tenant-isolation-tune, nextjs-api-routes-tune, nextjs-data-fetching-tune, nextjs-middleware-tune, node-error-handling-tune, node-streams-tune, oauth-flows-tune, openapi-spec-tune, playwright-selectors-tune, prompt-injection-defense-tune, python-async-tune, python-file-io-tune, rag-chunking-tune, rate-limiting-proxy-tune, react-server-components-tune, react-state-tune, redis-caching-tune, rest-pagination-tune, secrets-rotation-tune, shell-script-robustness-tune, sql-query-optimization-tune, stealth-web-research-tune, stripe-webhook-idempotency-tune, supabase-rls-tune, terraform-state-tune, typescript-generics-tune, user-onboarding-flow-tune, vercel-env-vars-tune, web-scraping-ethics-tune, web-vitals-optimization-tune, websocket-reconnection-tune

### Orchestration
intent-router

### Planning
a-b-testing-framework-plan, a11y-aria-patterns-plan, adr-documentation-plan, agent-tool-binding-plan, analytics-metric-definition-plan, aws-lambda-cold-start-plan, azure-bicep-plan, browser-devtools-plan, cli-tool-design-plan, cloud-cost-optimization-plan, code-review-checklist-plan, context-window-budget-plan, convex-functions-plan, cron-job-reliability-plan, css-layout-plan, csv-data-cleaning-plan, data-warehouse-schema-plan, database-migration-safety-plan, design-token-system-plan, docker-compose-networking-plan, docker-multistage-plan, drizzle-schema-design-plan, error-monitoring-setup-plan, fastapi-dependencies-plan, feature-flags-plan, git-conflict-resolution-plan, github-actions-pipeline-plan, graphql-n-plus-one-plan, jest-test-optimization-plan, json-schema-validation-plan, kubernetes-hpa-plan, kubernetes-pod-lifecycle-plan, mcp-tool-design-plan, message-queues-plan, multi-tenant-isolation-plan, nextjs-api-routes-plan, nextjs-data-fetching-plan, nextjs-middleware-plan, node-error-handling-plan, node-streams-plan, oauth-flows-plan, openapi-spec-plan, playwright-selectors-plan, prompt-injection-defense-plan, python-async-plan, python-file-io-plan, rag-chunking-plan, rate-limiting-proxy-plan, react-server-components-plan, react-state-plan, reasoning-architect, redis-caching-plan, rest-pagination-plan, secrets-rotation-plan, shell-script-robustness-plan, sql-query-optimization-plan, stealth-web-research-plan, stripe-webhook-idempotency-plan, supabase-rls-plan, terraform-state-plan, typescript-generics-plan, user-onboarding-flow-plan, vercel-env-vars-plan, web-scraping-ethics-plan, web-vitals-optimization-plan, websocket-reconnection-plan

### Quality
incident-debugger, verification-runner

### Security
a-b-testing-framework-harden, a11y-aria-patterns-harden, adr-documentation-harden, agent-tool-binding-harden, analytics-metric-definition-harden, aws-lambda-cold-start-harden, azure-bicep-harden, browser-devtools-harden, cli-tool-design-harden, cloud-cost-optimization-harden, code-review-checklist-harden, context-window-budget-harden, convex-functions-harden, cron-job-reliability-harden, css-layout-harden, csv-data-cleaning-harden, data-warehouse-schema-harden, database-migration-safety-harden, design-token-system-harden, docker-compose-networking-harden, docker-multistage-harden, drizzle-schema-design-harden, error-monitoring-setup-harden, fastapi-dependencies-harden, feature-flags-harden, git-conflict-resolution-harden, github-actions-pipeline-harden, graphql-n-plus-one-harden, jest-test-optimization-harden, json-schema-validation-harden, kubernetes-hpa-harden, kubernetes-pod-lifecycle-harden, mcp-tool-design-harden, message-queues-harden, multi-tenant-isolation-harden, nextjs-api-routes-harden, nextjs-data-fetching-harden, nextjs-middleware-harden, node-error-handling-harden, node-streams-harden, oauth-flows-harden, openapi-spec-harden, playwright-selectors-harden, prompt-injection-defense-harden, python-async-harden, python-file-io-harden, rag-chunking-harden, rate-limiting-proxy-harden, react-server-components-harden, react-state-harden, redis-caching-harden, rest-pagination-harden, secrets-rotation-harden, shell-script-robustness-harden, sql-query-optimization-harden, stealth-web-research-harden, stripe-webhook-idempotency-harden, supabase-rls-harden, terraform-state-harden, typescript-generics-harden, user-onboarding-flow-harden, vercel-env-vars-harden, web-scraping-ethics-harden, web-vitals-optimization-harden, websocket-reconnection-harden
__USB_CLAUDE_ROUTER_A3F6F4A23FAFE2C8__
    fi
    ;;
  hermes)
    DEST="${HERMES_SKILLS_DIR:-$HOME/.hermes/skills/$PACK_SLUG}"
    do_or_show mkdir -p "$DEST"
    do_or_show cp "$PACK_DIR/skills/"*.md "$DEST/"
    do_or_show cp "$PACK_DIR/skillpack.json" "$DEST/hermes.skillpack.json"
    do_or_show cp "$PACK_DIR/adapter.bridge.json" "$DEST/adapter.bridge.json"
    ;;
  cursor)
    # Cursor reads project rules from .cursor/rules INSIDE the project;
    # user-level rules are Settings-UI only, so a file written to
    # ~/.cursor/rules is never read. Default to the current project and say
    # where it went, since that only helps if you run this from the repo.
    DEST="${CURSOR_RULES_DIR:-$PWD/.cursor/rules}"
    do_or_show mkdir -p "$DEST"
    do_or_show cp "$PACK_DIR/cursor-rule.mdc" "$DEST/$PACK_SLUG.mdc"
    if [ "$USB_CHECK" != "1" ] && [ "${CURSOR_RULES_DIR:-}" = "" ]; then
      printf '%s[i]%s Cursor rules are per-project. Installed into %s%s%s — run USB from another
' "$CYA" "$RST" "$CYA" "$DEST" "$RST"
      printf '    project (or set CURSOR_RULES_DIR) to install them there too.
'
    fi
    ;;
  openai|anthropic|openrouter|groq|mistral)
    DEST="$ROOT/adapters/$TARGET"
    do_or_show mkdir -p "$DEST"
    do_or_show cp "$PACK_DIR/adapter.bridge.json" "$DEST/$PACK_SLUG.json"
    do_or_show cp "$PACK_DIR/skillpack.json" "$DEST/skillpack.json"
    ;;
  langchain|mcp)
    DEST="$ROOT/adapters/$TARGET"
    do_or_show mkdir -p "$DEST"
    do_or_show cp "$PACK_DIR/adapter.bridge.json" "$DEST/$PACK_SLUG.json"
    do_or_show cp "$PACK_DIR/skillpack.json" "$DEST/skillpack.json"
    ;;
  ollama|lm-studio|vllm)
    DEST="$ROOT/adapters/$TARGET"
    do_or_show mkdir -p "$DEST"
    do_or_show cp "$PACK_DIR/adapter.bridge.json" "$DEST/$PACK_SLUG.json"
    do_or_show cp "$PACK_DIR/skills/"*.md "$DEST/"
    ;;
  *)
    DEST="$PACK_DIR"
    ;;
esac

# --- Local install registry (always-on, no network, no PII) ---
INSTALL_RECORD="$PACK_DIR/installed.json"
write_file "$INSTALL_RECORD" <<'__USB_INSTALL_RECORD__'
{
  "pack": "__PACK_SLUG__",
  "version": "__PACK_VERSION__",
  "target": "__TARGET__",
  "skill_count": __SKILL_COUNT__,
  "installed_at": "__TIMESTAMP__"
}
__USB_INSTALL_RECORD__
if [ "$USB_CHECK" != "1" ]; then
  sed -i.bak \
    -e "s|__PACK_SLUG__|$PACK_SLUG|g" \
    -e "s|__PACK_VERSION__|$PACK_VERSION|g" \
    -e "s|__TARGET__|$TARGET|g" \
    -e "s|__SKILL_COUNT__|$SKILL_COUNT|g" \
    -e "s|__TIMESTAMP__|$(date -u +%Y-%m-%dT%H:%M:%SZ)|g" \
    "$INSTALL_RECORD"
  rm -f "$INSTALL_RECORD.bak"
fi

# --- Optional anonymous install telemetry (opt-in via env var) ---
if [ "${USB_TELEMETRY:-off}" = "on" ]; then
  TELEMETRY_URL="${USB_TELEMETRY_URL:-https://api.universal-skill-bridge.dev/v1/telemetry}"
  do_or_show curl -fsS -X POST -H "Content-Type: application/json" \
    --max-time 3 \
    -d "{\"target\":\"$TARGET\",\"pack\":\"$PACK_SLUG\",\"version\":\"$PACK_VERSION\",\"skills\":$SKILL_COUNT,\"ts\":$(date +%s)}" \
    "$TELEMETRY_URL" >/dev/null 2>&1 || true
fi

if [ "$USB_CHECK" = "1" ]; then
  printf '
[check] Would write %s skills. Re-run without --check to actually install.
' "$SKILL_COUNT"
  printf '  [would] pack dir:    %s
' "$PACK_DIR"
  printf '  [would] registry:    %s
' "$INSTALL_RECORD"
  printf '  [would] target:      (resolved after auto-detect — see logs above)
'
  exit 0
fi

SKILL_UNIT="skills"; [ "$SKILL_COUNT" = "1" ] && SKILL_UNIT="skill"
echo "✅ $PACK_SLUG v$PACK_VERSION installed for target: $TARGET ($SKILL_COUNT $SKILL_UNIT)"
echo "📦 Portable pack: $PACK_DIR"
echo "🔌 Target files: ${DEST:-$PACK_DIR}"
echo "📝 Local registry: $INSTALL_RECORD"
echo "ℹ️  Tip: override the target folder with AI_SKILL_HOME, LEOSIS_SKILLS_DIR, CLAUDE_SKILLS_DIR, HERMES_SKILLS_DIR, or CURSOR_RULES_DIR."
echo "💡 Optional: export USB_TELEMETRY=on to send anonymous install stats (target + pack + version, no PII)."

# ─────────────────────────────────────────────────────────────────
# Filter applied: 529 / 529 skills (0% smaller)
# Query: ?target=auto
# Verify with:  curl -fsSL "https://usb.peepsicklabs.com/api/install-sha256?target=auto"
# ─────────────────────────────────────────────────────────────────