specialized-patterns
<!-- Loaded by foundry:doc-scribe (sonnet + medium) -->
$ npx -y skills add Borda/AI-Rig --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
Context preview
The summary Claude sees to decide when to auto-load this agent.
<!-- Loaded by foundry:doc-scribe (sonnet + medium) -->
Agent definition
specialized-patterns.md<!-- Loaded by foundry:doc-scribe (sonnet + medium) -->
Specialized Docstring Patterns (foundry:doc-scribe specialized guidance)
Apply only when scoped task explicitly involves computer-vision / ML tensor docstrings or pyDeprecate migration guides. For routine docstring or README tasks, treat content below as inert reference — do NOT apply checklist heuristics.
Computer Vision (CV) / Tensor Docstring Checklist
**CV/ML projects only — strict two-category gate**: apply checklist only when function has BOTH
1. **Architectural signal** (at least one): `kernel_size`, `stride`, `padding`, `feature_map`, `dilation`, `groups` (structural CNN params) 2. **Visual-domain signal** (at least one, distinct from category 1): image dimensions (`(B, C, H, W)` shape with concrete spatial dims), pixel value range hints (`[0, 255]`, `[0, 1]`), bounding boxes, segmentation masks, or explicit `vision`/`image`/`detection`/`segmentation` keyword in docstring or surrounding context
A single param name (e.g. `image`) that could satisfy both categories does NOT count twice — the two signals must come from distinct evidence.
> **NOT-for — do not apply CV checklist to**: > - Audio DSP functions (`spectrogram`, `waveform`, `frame` as STFT frame, `mel_bins`) > - NLP / attention models (`attention_mask`, `hidden_state`, `token_ids`, even when `(B, C, H, W)`-like shapes appear) > - Medical imaging functions unless explicitly annotated as CV pipeline stage (NIfTI/DICOM-only volumetric utilities → use medical-imaging-specific subset of checklist; see RAS/LPS qualifier in Spatial convention) > - Generic image utilities (PIL resize, matplotlib display, OpenCV basic ops) with `image` param but no CNN architecture involvement
- **Shape**: exact dims with named axes (B, C, D, H, W) — e.g. `Shape: (B, C, H, W)`
- **Value range**: [0, 1], [0, 255], or [-1, 1]
- **Channel convention**: channel-first (PyTorch) vs channel-last (NumPy/TensorFlow (TF))
- **Spatial convention**: orientation (RAS/LPS), pixel vs world coordinates
- **dtype**: expected dtype (float32, uint8, int64)
- **Batch handling**: document if function accepts batched/unbatched inputs
Migration Guide Template (for API deprecation cycles)
When public API deprecated with pyDeprecate, write migration guide (deprecation lifecycle and pyDeprecate usage policy → `oss:shepherd` agent (requires `oss` plugin)):
- `## Migrating from \`old_function()\` to \`new_function()\`` — title with both names
- **Deprecated in**: version; **Removed in**: version
- `### Before (deprecated)` — minimal before-code example
- `### After` — equivalent after-code example
- `### Argument Mapping` — table: Old | New | Notes (renamed, removed, semantic change)
- Add to docs; hand off the CHANGELOG entry to `oss:shepherd` / `/oss:release` (requires `oss` plugin)
Read more
<!-- Loaded by foundry:doc-scribe (sonnet + medium) -->
Specialized Docstring Patterns (foundry:doc-scribe specialized guidance)
Apply only when scoped task explicitly involves computer-vision / ML tensor docstrings or pyDeprecate migration guides. For routine docstring or README tasks, treat content below as inert reference — do NOT apply checklist heuristics.
Computer Vision (CV) / Tensor Docstring Checklist
**CV/ML projects only — strict two-category gate**: apply checklist only when function has BOTH
1. **Architectural signal** (at least one): `kernel_size`, `stride`, `padding`, `feature_map`, `dilation`, `groups` (structural CNN params) 2. **Visual-domain signal** (at least one, distinct from category 1): image dimensions (`(B, C, H, W)` shape with concrete spatial dims), pixel value range hints (`[0, 255]`, `[0, 1]`), bounding boxes, segmentation masks, or explicit `vision`/`image`/`detection`/`segmentation` keyword in docstring or surrounding context
A single param name (e.g. `image`) that could satisfy both categories does NOT count twice — the two signals must come from distinct evidence.
> **NOT-for — do not apply CV checklist to**: > - Audio DSP functions (`spectrogram`, `waveform`, `frame` as STFT frame, `mel_bins`) > - NLP / attention models (`attention_mask`, `hidden_state`, `token_ids`, even when `(B, C, H, W)`-like shapes appear) > - Medical imaging functions unless explicitly annotated as CV pipeline stage (NIfTI/DICOM-only volumetric utilities → use medical-imaging-specific subset of checklist; see RAS/LPS qualifier in Spatial convention) > - Generic image utilities (PIL resize, matplotlib display, OpenCV basic ops) with `image` param but no CNN architecture involvement
- **Shape**: exact dims with named axes (B, C, D, H, W) — e.g. `Shape: (B, C, H, W)`
- **Value range**: [0, 1], [0, 255], or [-1, 1]
- **Channel convention**: channel-first (PyTorch) vs channel-last (NumPy/TensorFlow (TF))
- **Spatial convention**: orientation (RAS/LPS), pixel vs world coordinates
- **dtype**: expected dtype (float32, uint8, int64)
- **Batch handling**: document if function accepts batched/unbatched inputs
Migration Guide Template (for API deprecation cycles)
When public API deprecated with pyDeprecate, write migration guide (deprecation lifecycle and pyDeprecate usage policy → `oss:shepherd` agent (requires `oss` plugin)):
- `## Migrating from \`old_function()\` to \`new_function()\`` — title with both names
- **Deprecated in**: version; **Removed in**: version
- `### Before (deprecated)` — minimal before-code example
- `### After` — equivalent after-code example
- `### Argument Mapping` — table: Old | New | Notes (renamed, removed, semantic change)
- Add to docs; hand off the CHANGELOG entry to `oss:shepherd` / `/oss:release` (requires `oss` plugin)
Specialist-agent infrastructure for Python/ML OSS — the scaffolding that lets you maintain at scale without becoming a full-time reviewer.
Repo: Borda/AI-Rig
Other agents on ai-rig.
- challenger
Adversarial review — drills to bedrock, treats claims as unproven until evidence. NOT for: plan design (foundry:solution-architect), test coverage (foundry:qa-specialist), config formatting (foundry:curator). TRIGGER: "challenge this", "devil''s advocate", "poke holes in". SKIP:
Open agent - creator
Content specialist — blog posts, slide decks, social threads, talk abstracts. Reads approved outline, applies four-beat arc. NOT for in-code docs/README/FAQs (foundry:doc-scribe), release notes (oss:release). TRIGGER: "write a blog post", "create slides", "draft a thread". SKIP:
Open agent - curator
Config quality reviewer. Scope: agents/skills/rules (*.md) — verbosity, duplication, cross-refs, roster overlap; applies fixes. NOT for hooks (foundry:sw-engineer), ADRs (foundry:solution-architect), adversarial challenge (foundry:challenger). TRIGGER: "audit this agent",
Open agent - doc-scribe
Docs specialist — docstrings, API refs, README, standalone FAQ/comparison tables. NOT for CHANGELOG (oss:shepherd), linting (foundry:linting-expert), implementation (foundry:sw-engineer), narrative content (foundry:creator). TRIGGER: "write docs for", "add docstrings to",
Open agent - linting-expert
Python static analysis — ruff, mypy, pre-commit, lint/type fixes, type annotations. NOT for CI topology (oss:cicd-steward), test logic (foundry:qa-specialist), non-style implementation (foundry:sw-engineer), docstrings (foundry:doc-scribe). TRIGGER: "is this clean", "lint
Open agent - perf-optimizer
Perf engineer — CPU/GPU/memory/I/O bottlenecks, DataLoader throughput, PyTorch tuning. Profile-first, measures before changing. NOT for refactoring (foundry:sw-engineer), architecture (foundry:solution-architect), DataLoader correctness (research:data-steward). TRIGGER: "why is
Open agent

