packaging-patterns
<!-- file: packaging-patterns.md — consumers: agents/sw-engineer.md (<oss_patterns> trigger) -->
$ 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.
<!-- file: packaging-patterns.md — consumers: agents/sw-engineer.md (<oss_patterns> trigger) -->
Agent definition
packaging-patterns.md<!-- file: packaging-patterns.md — consumers: agents/sw-engineer.md (<oss_patterns> trigger) -->
src Layout (mandatory for libraries)
mypackage/ ├── src/ │ └── mypackage/ │ ├── __init__.py # export public API + __all__ │ ├── _internal.py # private, underscore-prefixed │ └── module.py ├── tests/ ├── pyproject.toml └── README.md
Deprecation (mandatory for public API changes)
Use `typing_extensions.deprecated` (PEP 702) — verify project preference with maintainer or `oss:shepherd` (requires `oss` plugin) for full release patterns. Prefer dedicated library over raw `warnings.warn` — handles argument forwarding, "warn once" dedup, automatic call delegation.
**Key rules**: set `deprecated_in` + `remove_in`, add `.. deprecated:: X.Y.Z` Sphinx directive in docstring.
API Stability
- Mark experimental APIs with `# experimental: API may change without notice`
- Derive `__version__` in `__init__.py` from package metadata — `from importlib.metadata import version; __version__ = version("mypackage")`; pyproject.toml stays the single source of truth
- SemVer: MAJOR.MINOR.PATCH — breaking changes only in MAJOR
- Never remove public API without deprecation cycle spanning ≥1 minor release
- **Rename with backward compat**: assign `OldName = NewName` as deprecated alias for one major cycle, then remove
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 - specialized-patterns
<!-- Loaded by foundry:doc-scribe (sonnet + medium) -->
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

