$npx -y skills add Borda/AI-Rig --skill topicResearch State of the Art (SOTA) literature for an Artificial Intelligence / Machine Learning (AI/ML) topic, method, or architecture. Finds relevant papers, builds a comparison table, recommends the best implementation strategy for the current codebase, and optionally produces a
| 1 | <objective> |
| 2 | |
| 3 | Research AI/ML topic literature. Return actionable findings: SOTA methods, best fit, concrete implementation plan. Skill = orchestrator — gathers codebase context, delegates literature search to researcher agent, packages results into structured report. |
| 4 | |
| 5 | NOT for deep single-paper analysis or experiment design — use `research:scientist` directly for hypothesis generation, ablation design, experiment validation. |
| 6 | |
| 7 | </objective> |
| 8 | |
| 9 | <inputs> |
| 10 | |
| 11 | - **$ARGUMENTS**: one of: |
| 12 | - `<topic>` — topic, method name, or problem description (e.g. "object detection for small objects", "efficient transformers", "self-supervised pretraining for medical images") |
| 13 | - `plan` — produce phased implementation plan from most recent research output (auto-detected from `.temp/`) |
| 14 | - `plan <path-to-output.md>` — produce plan from specific existing research output file |
| 15 | - `--team` — multi-agent mode; spawns 2–3 researcher teammates for topics with 3+ competing method families and no SOTA consensus; ~7× token cost vs single-agent mode |
| 16 | |
| 17 | </inputs> |
| 18 | |
| 19 | <compaction> |
| 20 | |
| 21 | Key boundary: end of Step 2 — SOTA literature gathered and written to AGENT_OUT; before Step 3 report synthesis. |
| 22 | Preserve: AGENT_OUT path (TMPDIR key), BRANCH (TMPDIR key), DATE (TMPDIR key), REPORT_OUT target path, topic string from ARGUMENTS. |
| 23 | Clear at Step 1 start (stale prior run) and at follow-up gate (terminal action). |
| 24 | |
| 25 | </compaction> |
| 26 | |
| 27 | <workflow> |
| 28 | |
| 29 | <!-- Agent resolution: see _RESEARCH_SHARED/agent-resolution.md --> |
| 30 | |
| 31 | ## Agent Resolution |
| 32 | |
| 33 | **Agent resolution**: load and follow the protocol below. Contains: foundry check + fallback table. Foundry not installed → substitute each `foundry:X` with `general-purpose` per table. Agents this skill uses: `foundry:solution-architect`. |
| 34 | |
| 35 | ```bash |
| 36 | # loads: compaction-contract.md |
| 37 | _RESEARCH_SHARED=$(python "${CLAUDE_PLUGIN_ROOT:-plugins/cc_research}/bin/resolve_shared.py" 2>/dev/null) # timeout: 5000 |
| 38 | [ -z "$_RESEARCH_SHARED" ] && { echo "! Plugin path resolution failed — ensure research plugin installed and CLAUDE_PLUGIN_ROOT set, or invoke from project root."; exit 1; } |
| 39 | cat "$_RESEARCH_SHARED/agent-resolution.md" |
| 40 | ``` |
| 41 | |
| 42 | **Task hygiene**: Before creating tasks, call `TaskList`. For each found task: |
| 43 | |
| 44 | - status `completed` if work clearly done |
| 45 | - status `deleted` if orphaned / no longer relevant |
| 46 | - keep `in_progress` only if genuinely continuing |
| 47 | |
| 48 | **Task tracking**: per CLAUDE.md, create tasks (TaskCreate) for each major phase — paper collection, researcher analysis, report generation. Mark in_progress/completed throughout. |
| 49 | |
| 50 | ## Step 1: Understand the codebase context |
| 51 | |
| 52 | Read current project before searching, extract constraints: |
| 53 | |
| 54 | - Framework (PyTorch, JAX, TensorFlow, scikit-learn)? |
| 55 | - Task (classification, detection, generation, regression)? |
| 56 | - Constraints (latency, memory, dataset size, compute budget)? |
| 57 | |
| 58 | **Case-insensitive flag/mode normalization** — normalize before parsing so `--PLAN`, `--Team`, `Plan`, etc. accepted. Each Bash tool call runs fresh shell, so lowercased copy does NOT persist across blocks — re-derive inline from `$ARGUMENTS` (harness-substituted every block) wherever dispatch check needs it, e.g. `echo "$ARGUMENTS" | tr '[:upper:]' '[:lower:]' | …`. Preserve original `$ARGUMENTS` only where literal substitution into prompts required (e.g. topic string). |
| 59 | |
| 60 | **Unsupported flag check** (runs BEFORE any mode dispatch to catch unknown flags in all modes): load and follow the protocol below. Supported flags for this skill: `--team`, `--keep`. |
| 61 | ```bash |
| 62 | # loads: unsupported-flag-protocol.md |
| 63 | _RESEARCH_SHARED=$(python "${CLAUDE_PLUGIN_ROOT:-plugins/cc_research}/bin/resolve_shared.py" 2>/dev/null) # timeout: 5000 |
| 64 | cat "$_RESEARCH_SHARED/unsupported-flag-protocol.md" |
| 65 | ``` |
| 66 | |
| 67 | ```bash |
| 68 | # Extract --keep quoted value (compaction-contract.md §keep semantics) |
| 69 | KEEP_ITEMS="" |
| 70 | if [[ "$ARGUMENTS" =~ --keep[[:space:]]\"([^\"]+)\" ]]; then |
| 71 | KEEP_ITEMS="${BASH_REMATCH[1]}" |
| 72 | fi |
| 73 | export CSID="${CLAUDE_CODE_SESSION_ID:-$PPID}" |
| 74 | # Clear stale contract from any prior incomplete run (compaction-contract.md §Lifecycle) |
| 75 | rm -f .temp/state/skill-contract.md # timeout: 5000 |
| 76 | echo "${KEEP_ITEMS:-}" > "${TMPDIR:-/tmp}/topic-keep-items-${CSID}" # persist for Step 2 contract write |
| 77 | ``` |
| 78 | |
| 79 | ```bash |
| 80 | UNKNOWN_FLAGS=$(echo "$ARGUMENTS" | tr '[:upper:]' '[:lower:]' | gre |