Skip to content

Commit 956b391

Browse files
Bordaclaude
andcommitted
refine(oss,foundry): distill code-review patterns
- oss:review complexity smell now also triggers on PY_LOC_DELTA >400 (header annotation; no split-request action) - shepherd-reply-protocol: add `praise`/`learning` as valid Importance values in Part 2 inline suggestions table - solution-architect: add LSP violation + ISP violation antipatterns (subclass NotImplementedError/cast-at-call-site; oversized Protocol/ABC) - qa-specialist: add shell-injection conditional context row (os.system/subprocess — verify shell=False and list args) Distilled from https://github.com/awesome-skills/code-review-skill (MIT). Challenger-reviewed; 3 proposals discarded (bulk python.md injection, pr-analyzer.py, language guides). --- Co-authored-by: Claude Code <noreply@anthropic.com>
1 parent 4ea3ed8 commit 956b391

36 files changed

Lines changed: 249 additions & 155 deletions

File tree

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg) [![Claude Code](https://img.shields.io/badge/Claude_Code-plugin-orange)](https://claude.ai/code) [![Codex CLI](https://img.shields.io/badge/Codex_CLI-config-green)](https://github.com/openai/codex)
44

5+
Specialist-agent infrastructure for Python/ML OSS — the scaffolding that lets you maintain at scale without becoming a full-time reviewer.
6+
57
**14 specialist agents · 20+ slash-command workflows · 5 domain plugins** — opinionated [Claude Code](https://claude.ai/code) + [Codex CLI](https://github.com/openai/codex) configuration for Python/ML OSS maintainers, version-controlled and self-calibrating.
68

79
<details>
@@ -52,13 +54,10 @@ Things not possible with vanilla Claude Code:
5254
# Install Claude Code
5355
npm install -g @anthropic-ai/claude-code
5456

55-
# 1. Clone (run from the directory that will CONTAIN the clone)
56-
git clone https://github.com/Borda/AI-Rig Borda-AI-Rig
57-
58-
# 2. Register as a local marketplace
59-
claude plugin marketplace add ./Borda-AI-Rig
57+
# 1. Register from GitHub (no clone needed)
58+
claude plugin marketplace add Borda/AI-Rig
6059

61-
# 3. Install all five plugins
60+
# 2. Install plugins — pick what you need
6261
claude plugin install foundry@borda-ai-rig # base agents + audit, manage, calibrate, brainstorm, …
6362
claude plugin install oss@borda-ai-rig # OSS workflow: analyse, review, resolve, release
6463
claude plugin install develop@borda-ai-rig # development: feature, fix, refactor, plan, debug
@@ -70,19 +69,20 @@ claude plugin install codemap@borda-ai-rig # structural index: import graph, b
7069
>
7170
> **Safe to install alongside any existing Claude Code setup.** Plugins live in a private cache (`~/.claude/plugins/cache/<plugin>/`) under their own namespace. Your existing `~/.claude/agents/`, `~/.claude/skills/`, and `settings.json` are never modified or overwritten — custom agents and skills you have created remain fully independent. See the [Claude Code plugin reference](https://code.claude.com/docs/en/plugins-reference) for details.
7271
73-
**4. One-time settings merge** — run inside Claude Code:
72+
**3. One-time settings merge** — run inside Claude Code:
7473

7574
```text
76-
/foundry:init
75+
/foundry:setup
7776
```
7877

7978
OSS, develop, and research skills always use their plugin prefix (`/oss:review`, `/develop:fix`, `/research:run`). Safe to re-run.
8079

8180
> [!IMPORTANT]
8281
>
83-
> **Codex CLI** — optional companion; the plugins install Claude Code agents and skills only:
82+
> **Codex CLI** — optional companion; requires a local clone (`.codex/` config is not a plugin):
8483
>
8584
> ```bash
85+
> git clone https://github.com/Borda/AI-Rig Borda-AI-Rig
8686
> npm install -g @openai/codex
8787
> cp -r Borda-AI-Rig/.codex/ ~/.codex/ # Codex agents and profiles
8888
> ```
@@ -126,6 +126,8 @@ Managing AI coding workflows for Python/ML OSS is complex — you need domain-aw
126126
- ML training and inference codebases needing GPU profiling and data pipeline validation
127127
- Multi-contributor projects with CI/CD, pre-commit hooks, and automated releases
128128
129+
A typical maintainer morning — 15 issues, 3 PRs, a release due — handled in one session with four commands (see Daily OSS Workflow above).
130+
129131
## 💡 Design Principles
130132
131133
- **Agents are roles, skills are workflows** — agents carry domain expertise, skills orchestrate multi-step processes
@@ -172,7 +174,7 @@ Agents and skills for [Claude Code](https://claude.ai/code) (Anthropic's AI codi
172174
173175
Skills are multi-agent workflows invoked via slash commands. Each skill composes several agents in a defined topology.
174176
175-
After running `/foundry:init`, foundry skills are available without a prefix. OSS, develop, and research skills always use their plugin prefix.
177+
After running `/foundry:setup`, foundry skills are available without a prefix. OSS, develop, and research skills always use their plugin prefix.
176178
177179
| Skill | What It Does |
178180
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -443,19 +445,19 @@ AI-Rig/
443445
### Upgrade
444446
445447
```bash
446-
cd Borda-AI-Rig && git pull
447448
claude plugin install foundry@borda-ai-rig # reinstalls from updated source
448449
claude plugin install oss@borda-ai-rig
449450
claude plugin install develop@borda-ai-rig
450451
claude plugin install research@borda-ai-rig
451452
claude plugin install codemap@borda-ai-rig
452453
```
453454
454-
Re-run `/foundry:init` only if permissions or `enabledPlugins` changed. Re-run `/foundry:init` if you previously used the link mode — symlinks point to the old plugin cache after an upgrade.
455+
Re-run `/foundry:setup` only if permissions or `enabledPlugins` changed. Re-run `/foundry:setup` if you previously used the link mode — symlinks point to the old plugin cache after an upgrade.
455456
456457
### Session-only (no install, for development)
457458
458459
```bash
460+
git clone https://github.com/Borda/AI-Rig Borda-AI-Rig
459461
claude --plugin-dir ./Borda-AI-Rig/plugins/foundry
460462
```
461463
@@ -469,7 +471,7 @@ claude plugin uninstall research
469471
claude plugin uninstall codemap
470472
```
471473
472-
Settings added by `/foundry:init` remain in `~/.claude/settings.json`; remove manually if desired. If `/foundry:init` was run, symlinks in `~/.claude/agents/` and `~/.claude/skills/` also persist and will be broken after uninstall — remove with `rm ~/.claude/agents/<name>.md` and `rm -rf ~/.claude/skills/<name>` for each.
474+
Settings added by `/foundry:setup` remain in `~/.claude/settings.json`; remove manually if desired. If `/foundry:setup` was run, symlinks in `~/.claude/agents/` and `~/.claude/skills/` also persist and will be broken after uninstall — remove with `rm ~/.claude/agents/<name>.md` and `rm -rf ~/.claude/skills/<name>` for each.
473475
474476
______________________________________________________________________
475477

plugins/codemap/skills/integration/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: integration
33
description: "Manage codemap integration — 'check' audits installation health (scan-query reachable, index fresh, injection present), 'init' onboards codemap by discovering skills/agents, recommending injection sites, and wiring them in."
44
argument-hint: "check | init [--approve] # --approve: non-interactive, auto-applies all High+Medium injection recommendations and installs post-commit hook"
55
effort: medium
6-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent, AskUserQuestion
77
model: sonnet
88
---
99

plugins/develop/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"license": "MIT",
88
"name": "develop",
99
"repository": "https://github.com/Borda/AI-Rig",
10-
"version": "0.7.4"
10+
"version": "0.7.5"
1111
}

plugins/develop/skills/debug/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ Evidence: <key signals>
298298
**Refinements**: N passes.
299299
```
300300
301-
**Follow-up gate (NEVER SKIP)** — Call `AskUserQuestion` tool — do NOT write options as plain text first. Map options directly into tool call arguments:
301+
**Follow-up gate (NEVER SKIP)** — Call `AskUserQuestion` tool — do NOT write options as plain text first. Substitute actual `$DIAG_FILE` path (from bash block above) into option (a) label before calling tool. Map options directly into tool call arguments:
302302
- question: "Proceed with fix?"
303-
- (a) label: `/develop:fix --diagnosis $DIAG_FILE` — description: proceed with fix using confirmed diagnosis
303+
- (a) label: `/develop:fix --diagnosis <DIAG_FILE>` (substitute resolved path, e.g. `/develop:fix --diagnosis .plans/active/debug_<slug>.md`) — description: proceed with fix using confirmed diagnosis
304304
- (b) label: `skip` — description: no action
305305
306306

plugins/foundry/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"license": "MIT",
1616
"name": "foundry",
1717
"repository": "https://github.com/Borda/AI-Rig",
18-
"version": "0.23.0"
18+
"version": "0.23.1"
1919
}

plugins/foundry/agents/creator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: creator
3-
description: 'Developer advocacy content specialist for outward-facing narrative artifacts — blog posts, Marp slide decks, social threads, talk abstracts, and lightning talk outlines. Imagines the ideal reader experience first, then works backwards to structure and form. Questions status-quo conventions before accepting them; pushes for genuinely fresh angles. Reads an approved outline file (.plans/content/<slug>-outline.md) produced by the /foundry:create skill and generates the complete content artifact in one autonomous pass. Applies a four-beat story arc (Problem → Journey → Insight → Action) calibrated to the target audience. NOT for in-code documentation (docstrings, API refs, README) — use foundry:doc-scribe. NOT for release notes or changelogs — use /oss:release (requires `oss` plugin). NOT for structured reference content (FAQs, comparison tables) — those are doc-scribe scope; redirect to foundry:doc-scribe. TRIGGER when: outline file at .plans/content/<slug>-outline.md approved; user asks to write a blog post, slide deck, social thread, talk abstract, or lightning talk outline; phrases: "write a blog post", "create slides", "draft a thread", "write a talk abstract", "write a CFP submission". SKIP: outline file not found (evaluated by dispatch-time caller before spawning creator; run /foundry:create first); code documentation task (use foundry:doc-scribe); release notes or changelogs (use /oss:release — requires `oss` plugin).'
3+
description: 'Developer advocacy content specialist for outward-facing narrative artifacts — blog posts, Marp slide decks, social threads, talk abstracts, and lightning talk outlines. Imagines the ideal reader experience first, then works backwards to structure and form. Questions status-quo conventions before accepting them; pushes for genuinely fresh angles. Reads an approved outline file (.plans/content/<slug>-outline.md) produced by the /foundry:create skill and generates the complete content artifact in one autonomous pass. Applies a four-beat story arc (Problem → Journey → Insight → Action) calibrated to the target audience. NOT for in-code documentation (docstrings, API refs, README) — use foundry:doc-scribe. NOT for release notes or changelogs — use /oss:release (requires `oss` plugin). NOT for structured reference content (FAQs, comparison tables, feature matrices, decision guides) — standalone reference artifacts route to foundry:doc-scribe; a blog post with an embedded comparison section is still creator scope (narrative arc, not standalone reference). TRIGGER when: outline file at .plans/content/<slug>-outline.md approved; user asks to write a blog post, slide deck, social thread, talk abstract, or lightning talk outline; phrases: "write a blog post", "create slides", "draft a thread", "write a talk abstract", "write a CFP submission". SKIP: outline file not found (evaluated by dispatch-time caller before spawning creator; run /foundry:create first); code documentation task (use foundry:doc-scribe); release notes or changelogs (use /oss:release — requires `oss` plugin); full artifact is structured reference format without narrative arc (use foundry:doc-scribe).'
44
tools: Read, Write, Grep, Glob, AskUserQuestion
55
model: sonnet
66
color: purple

plugins/foundry/agents/doc-scribe.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: doc-scribe
3-
description: 'Documentation specialist for writing docstrings, API references, and README files. Owns all FAQ and comparison-table reference content, including standalone FAQs. Use for auditing missing docstrings, writing Google-style docstrings from code, creating or updating README content, and finding doc/code inconsistencies. NOT for CHANGELOG entries or release notes (use oss:shepherd for lifecycle/format decisions, /oss:release skill for automated generation), NOT for release lifecycle README sections (version badges, PyPI install link) — use oss:shepherd, NOT for linting code examples (use foundry:linting-expert), NOT for implementation code (use foundry:sw-engineer), NOT for outward-facing narrative artifacts like blog posts, talk slides, or social threads — use foundry:creator. TRIGGER when: user asks for documentation — docstrings, README section, API reference, code comments; phrases: "write docs for", "add docstrings to", "update the README", "document this function", "add API reference". SKIP: documentation is one sentence (answer inline); user asking about existing docs read-only; implementation task (use foundry:sw-engineer).'
3+
description: 'Documentation specialist for writing docstrings, API references, and README files. Owns all FAQ and comparison-table reference content, including standalone FAQs. Use for auditing missing docstrings, writing Google-style docstrings from code, creating or updating README content, and finding doc/code inconsistencies. NOT for CHANGELOG entries or release notes (use oss:shepherd for lifecycle/format decisions, /oss:release skill for automated generation), NOT for release lifecycle README sections (version badges, PyPI install link) — use oss:shepherd, NOT for linting code examples (use foundry:linting-expert), NOT for implementation code (use foundry:sw-engineer), NOT for outward-facing narrative artifacts like blog posts, talk slides, or social threads — use foundry:creator. TRIGGER when: user asks for documentation — docstrings, README section, API reference, code comments; phrases: "write docs for", "add docstrings to", "update the README", "document this function", "add API reference", "write a FAQ", "create a comparison table", "write a feature matrix". SKIP: documentation is one sentence (answer inline); user asking about existing docs read-only; implementation task (use foundry:sw-engineer).'
44
tools: Read, Write, Edit, Bash, Grep, Glob, WebFetch, TaskCreate, TaskUpdate
55
model: sonnet
66
effort: medium
@@ -142,6 +142,7 @@ See **Prompt-Scope Gate** above for scope-filtering rules.
142142

143143
- FAQ entries and comparison tables are doc-scribe scope — both standalone and co-located with API docs
144144
- NOT for outward-facing narrative artifacts (blog posts, talk abstracts, social threads) → route to `foundry:creator`
145+
- Exception: comparison sections embedded within narrative artifacts (blog posts, slide decks) are creator scope — doc-scribe handles only standalone reference documents
145146

146147
</quality_checks>
147148

plugins/foundry/agents/linting-expert.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: linting-expert
3-
description: 'Static analysis and tooling specialist for Python. Use for configuring ruff rules, mypy strictness, pre-commit hooks, fixing lint/type violations, adding missing type annotations to Python source files, and defining the lint/type tool content of quality gates. Handles final code sanitization before handover. NOT for CI pipeline structure, runner strategy, or workflow topology (use oss:cicd-steward), NOT for writing test logic (use foundry:qa-specialist), NOT for implementation fixes beyond annotation/style (use foundry:sw-engineer), NOT for inline docstrings or API reference writing (use foundry:doc-scribe). TRIGGER when: after code edits when user asks "is this clean", "any lint issues", "check formatting", "check types"; linting or type errors visible in output; user pastes code with visible style violations and asks for review. SKIP: code is Python stdlib only with no project config; user explicitly said linting not needed; general code review (use foundry:sw-engineer).'
3+
description: 'Static analysis and tooling specialist for Python. Use for configuring ruff rules, mypy strictness, pre-commit hooks, fixing lint/type violations, adding missing type annotations to Python source files, and defining the lint/type tool content of quality gates. Handles final code sanitization before handover. NOT for CI pipeline structure, runner strategy, or workflow topology (use oss:cicd-steward), NOT for writing test logic (use foundry:qa-specialist), NOT for implementation fixes beyond annotation/style (use foundry:sw-engineer), NOT for inline docstrings or API reference writing (use foundry:doc-scribe). TRIGGER when: after code edits when user asks "is this clean", "any lint issues", "check formatting", "check types"; linting or type errors visible in output; user pastes code with visible style violations and asks for review; user asks to add type annotations to existing code ("add type hints", "annotate this module", "fix annotation errors"). SKIP: code is Python stdlib only with no project config; user explicitly said linting not needed; general code review (use foundry:sw-engineer).'
44
tools: Read, Write, Edit, Bash, Grep, Glob, TaskCreate, TaskUpdate, WebFetch
55
model: haiku
66
effort: medium
@@ -375,6 +375,7 @@ Don't apply uniform hedge — produces systematic calibration bias. Only list Ga
375375
- CI quality-gate YAML (workflow steps for ruff + mypy) → `oss:cicd-steward` (requires `oss` plugin)
376376
- Test coverage gaps or edge-case matrices → `foundry:qa-specialist`
377377
- Type annotation patterns in ML/tensor code → `foundry:sw-engineer` or `foundry:perf-optimizer`
378+
- Standalone annotation task on existing code (no implementation changes) → linting-expert; annotations written alongside new implementation → `foundry:sw-engineer`
378379

379380
**Incoming handovers**:
380381

plugins/foundry/agents/qa-specialist.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ Never claim pattern exists without confirming via Grep/Glob first. Applies to al
192192
| File uploads or `open()` calls | Check for size limits and path traversal prevention |
193193
| External API calls (`requests.`, `httpx.`, `aiohttp.`, `fetch`) | Check timeout, retry, and error handling *[sw-engineer domain — flag as observation only]* |
194194
| New `import`/`from` packages | Verify package exists in `pyproject.toml` / `requirements*.txt` |
195+
| `os.system(`, `subprocess.*`, `shlex` | Check shell-injection: verify `shell=False` (or kwarg absent); args must be list, not f-string or concatenated string; `shlex.quote()` only valid when `shell=True` strictly unavoidable |
195196

196197
**Domain-boundary rule**: rows tagged `[perf-optimizer domain]` or `[sw-engineer domain]` surface as observations, not qa defects. Don't count in coverage-gap totals; redirect substantive findings to owning agent.
197198

plugins/foundry/agents/solution-architect.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ Every artifact written to file (`docs/adr/`, `docs/design/`, or user-specified p
224224
| Type-annotation circular import | Use `from __future__ import annotations` + `TYPE_CHECKING` guard: `if TYPE_CHECKING: from module import Type` — eliminates runtime import while preserving type checker support |
225225
| Destructive migration before consumer cutover | Use expand-contract: add new columns, deploy reader of new columns, then drop old columns in separate migration after all readers migrated |
226226
| Undocumented boundary placement | Write ADR before any restructure; must state ownership principle so future engineers don't re-create same ambiguity |
227+
| LSP violation | Subclass overrides with `NotImplementedError`/`pass` body or call sites use `isinstance`/cast before using base type → flatten hierarchy; prefer Protocol structural typing over ABC enforcement |
228+
| ISP violation | Protocol or ABC with >5 methods where callers use only a partial subset → split into focused protocols per usage cluster; Protocol over ABC for structural typing in Python |
227229
228230
</antipatterns_to_flag>
229231

0 commit comments

Comments
 (0)