/oss:setup [--approve]from oss
Post-install setup for the oss plugin: symlinks rules/*.md into ~/.claude/rules/ as namespaced files and merges permissions into settings.json. Run once after installing or upgrading.
Ships in oss. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Deliver oss's rules to Claude's user-level rule namespace, and its own permission rules to Claude's settings.
| Action | What happens |
|---|---|
rules/*.md → ~/.claude/rules/oss-<name>.md | symlink |
| Stale link from an older oss version | refreshed silently |
| Link whose source left the plugin | removed |
| Real file or foreign link at a destination | preserved, reported as conflict |
Anything outside ~/.claude/rules/ | never touched |
.claude-plugin/permissions-{allow,deny}.json → ~/.claude/settings.json | merged additively except for the exact shipped retired allow entries |
Any other key of ~/.claude/settings.json | never touched |
Why namespaced? Claude loads user rules from one flat directory. Four plugins ship a rules/quality-gates.md; installing source basenames would collide. Every rule installs as <plugin>-<source-name>.md, so quality-gates.md becomes oss-quality-gates.md. The prefix is inert — verified against Claude Code 2.1.220 that a filename prefix changes neither unconditional loading nor paths: frontmatter matching.
Why symlink, not copy? Rules load at session start. A symlink serves the installed version after every upgrade; a copy silently serves stale content forever.
Why does oss deliver only its own rules? Each plugin installs independently. A plugin that shipped a sibling's rules would break standalone installation and couple releases. Still true with the delta variant: oss-quality-gates.md links either rules/quality-gates-delta.md (when a foundry-owned foundry-quality-gates.md is already delivered) or the complete rules/quality-gates.md (when it is not) — both sources belong to this plugin, and the delta only points at foundry's copy for the shared obligations rather than delivering it. Standalone install loses no rule; all four quality-gates.md copies loading at once was 51,274 B of context on every turn.
NOT for: statusLine, TEAM_PROTOCOL.md, or plugin-cache purging — those are /foundry:setup (requires foundry plugin). Of ~/.claude/settings.json only permissions.allow and permissions.deny arrays are touched, additively except for removing exactly the retired allow entries listed in permissions-allow-retired.json. Writes nothing under ~/.codex/.
--approve — non-interactive; replaces conflicting links without asking and preserves real user files. Used by make sync-claude.Parse $ARGUMENTS for --approve (case-insensitive) → APPROVE_ALL=true, else false. Any other --<token> → print ! Unknown flag(s): `--<token>`. Supported: `--approve`. and stop.
# later steps run bare `python` (plugin bin/python shim on PATH) — probe that exact command
python --version 2>&1 | grep -qE "Python 3\.(1[0-9]|[2-9][0-9])" || { printf "! Python 3.10+ not found as 'python' — install it and re-run /oss:setup\n"; exit 1; }
printf " Python: %s\n" "$(python --version 2>&1)"
$CLAUDE_PLUGIN_ROOT is the installed plugin version. sync_rules.py re-validates it (manifest exists, parses, declares oss; rules/ is a real directory holding at least one non-empty regular *.md) and aborts before touching anything if any check fails.
PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name oss) || exit $?; export PLUGIN_ROOT
python "$PLUGIN_ROOT/bin/sync_rules.py" --plugin-name oss --plugin-root "$PLUGIN_ROOT" --dry-run # timeout: 15000
Non-zero exit → print stderr verbatim and stop; nothing was modified.
Run without --dry-run. When APPROVE_ALL=false, run this fixed block:
PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name oss) || exit $?; export PLUGIN_ROOT
python "$PLUGIN_ROOT/bin/sync_rules.py" --plugin-name oss --plugin-root "$PLUGIN_ROOT" # timeout: 15000
When APPROVE_ALL=true, run this fixed block instead:
PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name oss) || exit $?; export PLUGIN_ROOT
python "$PLUGIN_ROOT/bin/sync_rules.py" --plugin-name oss --plugin-root "$PLUGIN_ROOT" --approve # timeout: 15000
Output lines, one per destination: linked: · unchanged: · replaced (explicit approval): · removed obsolete: · conflict, kept as-is: · FAILED:.
Ownership proved before any replace or remove: existing link must resolve under current plugin root, or under same ~/.claude/plugins/cache/<marketplace>/oss/ lineage as current install. A link into another marketplace, another plugin, a source checkout, or a dotfiles tree is never adopted — path substrings are not evidence of ownership.
No conflict, kept as-is: lines → skip to Step 5.
APPROVE_ALL=true with remaining conflicts → report them as undelivered and stop; do not assume replacement succeeded.
Otherwise invoke AskUserQuestion, listing each conflicting destination and its current state:
On (b), run this fixed replacement block only after the user explicitly chooses replacement, then report the resulting replaced (explicit approval): lines and sibling <destination>.bak-<timestamp> backups. --approve alone preserves real user files. On (a) or (c), report which rules remain undelivered.
PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name oss) || exit $?; export PLUGIN_ROOT
python "$PLUGIN_ROOT/bin/sync_rules.py" --plugin-name oss --plugin-root "$PLUGIN_ROOT" --approve --replace-user-files # timeout: 15000
This plugin ships its own permissions-allow.json and permissions-deny.json. Claude Code doesn't read them from plugin manifest, so without this step they're inert files — allow entries never suppress a prompt, deny entries never block anything.
Merge is idempotent: existing entries never duplicate. Each plugin merges only its own pair; the allow merge removes exactly the entries in permissions-allow-retired.json and preserves every other entry.
The merge removes exactly the retired allow entries listed in permissions-allow-retired.json, each shipped by an earlier oss version:
Bash(gh api repos/*:*) — nothing replaces it; the broad repository API allow entry is no longer shipped.Bash(uv pip install:*) — nothing replaces it. It auto-approved every uv pip install, including the review overlay's support check and wheel fetch, which must each reach their own permission prompt, and project-environment installs or source builds the overlay forbids.Bash(claude:*), Bash(find:*), Bash(node:*), Bash(sed:*) and Bash(eval:*) shell grants — nothing replaces them.Bash(sed -nE '…' "$REVIEW_FILE") PR-number grep — its regex * characters read as wildcards, so it approved other sed commands; bin/extract_review_pr.py replaces it.Retirement matches the rule text exactly, without tracking who added it. An identical user-authored entry, such as Bash(find:*), is removed too. Preserve every other user allow entry, all deny entries, and unrelated settings.
Deny wins over allow in Claude Code, so merging both in either order yields the same effective policy.
One block runs the whole step: create the file on first install (a standalone install may reach this step with no ~/.claude/settings.json at all), merge, then validate. Under its settings lock, merge_settings_permissions.py skips unchanged writes and backups; before a changed write it saves the original bytes in a private sibling backup and retains the newest five helper backups. It writes the merged permissions.allow and permissions.deny arrays in one atomic write, so allow never lands without deny; a missing or invalid shipped file aborts the block with settings unchanged.
PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name oss) || exit $?; export PLUGIN_ROOT
[ -f ~/.claude/settings.json ] || printf '{}\n' > ~/.claude/settings.json # created in-bash — no Write-tool prompt, headless-safe
python "$PLUGIN_ROOT/bin/merge_settings_permissions.py" --allow "$PLUGIN_ROOT/.claude-plugin/permissions-allow.json" --drop-allow-file "$PLUGIN_ROOT/.claude-plugin/permissions-allow-retired.json" --deny "$PLUGIN_ROOT/.claude-plugin/permissions-deny.json" || { printf "! permissions merge failed — settings.json unchanged\n"; exit 1; } # timeout: 5000
python -m json.tool ~/.claude/settings.json > /dev/null || { printf "! settings.json no longer parses — stop and inspect the reported helper backup\n"; exit 1; } # timeout: 5000 — Step 1 guarantees python; jq may be absent (native Windows)
Report the helper's settings: unchanged status or the backup path it printed for a changed merge. From the script's permission-count lines report "Added N new permissions.allow entries (M already present)." plus the total retired allow entries removed (dropped), and "Added N new permissions.deny entries (M already present)." Zero exit → continue to Step 6. Non-zero exit → report the failure and stop; merge failures leave settings unchanged, and validation failures require inspecting the reported helper backup before recovery.
~/.claude/rules/oss-*.mdfoundry plugin)Upgrade path: claude plugin install oss@borda-ai-rig then /oss:setup. Links from the previous version share the install-cache lineage, so they refresh without prompting; a rule dropped in the new version has its link removed. make sync-claude runs /oss:setup --approve headlessly for every installed managed plugin that ships a setup skill, so a normal sync needs no manual step.
Uninstall leaves state behind: Claude Code runs no cleanup hook on uninstall, neither claude plugin uninstall nor make clear-all removes what setup created. After removing the plugin, delete ~/.claude/rules/oss-*.md by hand — they become dangling symlinks once plugin cache version is gone.
Testing: setup is reachable only as /oss:setup after the plugin is installed. To exercise it locally, bump version in plugins/cc_oss/.claude-plugin/plugin.json, run claude plugin install oss@borda-ai-rig from the repo root to refresh the cache, then invoke the skill. bin/sync_rules.py is a byte-identical propagated copy of the canonical helper; its regression suite lives beside that canonical copy in the AI-Rig repository.
Follow-up gate omitted — setup is one-shot; Step 6 is terminal output.
What SKILL.md sets; muted values are Claude Code's defaults
lowThree short reads, in order
npx claudepluginhub borda/ai-rig --plugin oss5 skills in this plugin
/analyseAnalyze GitHub issues, Pull Requests (PRs), Discussions, and repo vitality for an Open Source Software (OSS) project. For any specific item, casts a wide net — finds and lists all related open and closed issues/PRs/discussions, explicitly flags duplicates. Summarizes long threads, extracts reproduction steps, and generates repo vitality stats. Uses gh Command Line Interface (CLI) for GitHub Application Programming Interface (API) access. For a PR, the main question is vitality: is its intent still aligned with the current codebase, and is it worth pushing forward as is, with minor changes or with major rework — judged from drift against the base, built for long-stale PRs. Complements oss:shepherd. NOT for PR readiness assessment or code review (use /oss:review).
TRIGGER when: user provides GitHub issue number (#N), PR number, or github.com URL with issue/PR/discussion path AND asks to analyze, summarize, understand, or triage it; user asks whether a stale or old PR is still worth pursuing, has drifted from the codebase, or should be revived or closed; user asks for repo vitality stats or "is this repo healthy"; user asks which release introduced the features later releases fixed, for a fix-lineage/fix-flow chart, or a feature/fix burn-up across releases (`evolution`).
SKIP: user already pasted full thread text inline; /oss:resolve already active on same PR; user wants code review (use /oss:review); user phrasing is "review PR" meaning code quality assessment, not thread triage (route to /oss:review).
/releasePrepare release communication and check readiness. Main mode: notes with optional flags --changelog, --summary, --migration, --append (incremental: reruns the full pipeline scoped to newly-landed commits, integrating results into existing DRAFT.md/CHANGELOG.md/SUMMARY.md/MIGRATION.md instead of full regenerate — non-destructive except revert/pivot and the re-folded DRAFT.md Summary); range as v1->v2. Other modes: prepare (full pipeline: audit → all artifacts), audit (pre-release readiness: blockers, docs alignment, version consistency, CVEs), demo (story-telling release notebook in jupytext # %% format). TRIGGER when: user requests release notes, CHANGELOG entry, migration guide, internal summary, release readiness audit, release demo, or an incremental update to an already-drafted release; phrases: 'draft release notes', 'prepare release', 'audit release readiness', 'generate CHANGELOG for v1->v2', 'release demo notebook', 'update release notes with the latest commits'. SKIP: actual git tagging or PyPI/registry upload (use git tag, gh release create, twine upload directly); release communication for a non-Python project where this skill's pytest-centric audit assumptions do not apply; PR-level review (use /oss:review); thread/issue analysis (use /oss:analyse)./resolveOSS maintainer fast-close workflow for GitHub PRs. Three phases: (1) PR intelligence — reads full thread, linked issues, PR body to synthesize contribution motivation and classify every comment into action items; (2) conflict resolution — checks out PR branch (fork-aware via gh pr checkout), merges BASE into it, resolves conflicts semantically using contributor's intent as priority lens; (3) implements each action item via specialist agents (Codex for eligible mechanical items) and commits per the chosen commit mode — one attributed commit per item by default — then pushes back to contributor's fork. Supports three source modes: pr (live GitHub comments only), report (latest /review report findings as action items, no GitHub re-fetch), and pr + report (both sources aggregated and deduplicated in one pass). Also accepts bare comment text for single-comment dispatch. NOT for reply drafting to /oss:analyse findings (use /oss:analyse --reply). NOT for code diff review of PR changes (use /oss:review). NOT for release preparation (use /oss:release). NOT for fixing local bugs unrelated to a PR (use /develop:fix; requires develop plugin). TRIGGER when: PR is ready to close and has open comments, conflicts, or review findings to address; user says 'close this PR', 'resolve comments on PR #N', or 'implement review findings'./reviewMulti-agent code review of GitHub Pull Requests (Python source, documentation (Markdown/RST), and CI/CD config PRs) covering architecture, tests, performance, docs, lint, security, and API design. TRIGGER when: user provides a GitHub PR number (e.g. 42, #42) and asks to review/audit/check it, or provides a saved review-report path with --reply to draft a contributor-facing comment; phrases: 'review PR 123', 'audit this pull request', 'look at PR #42', 'draft a reply for this review report'. SKIP: local file or current git diff review (use /develop:review (requires 'develop' plugin)); non-Python source PRs without Python files (TypeScript-only, Go-only, Rust-only); standalone issue/discussion thread analysis (use /oss:analyse).Other plugins' skills for the same job