/smg:contributefrom smg
Runs the full pre-PR gate for the SMG repository: formatting, linting, tests, pre-commit hooks, Python/Go lanes, Cargo.lock checks, vocabulary, and branch/commit rules. Use before committing, pushing, or opening a PR.
Ships in smg. 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.
Rule: no PR without the gate's table from this session. "Should pass" is not output.
bash "${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh" # from anywhere inside the SMG checkout
bash "${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh" --fix # let rustfmt / ruff / pre-commit rewrite files
bash "${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh" --skip-tests --only fmt,clippy,vocab,names # while iterating
GATE_TEST_ARGS="--lib" bash "${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh" --only test # narrow the test run further
bash "${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh" --scope workspace # clippy and tests on every crate (CI's clippy; main's whole test matrix)
bash "${CLAUDE_PLUGIN_ROOT}/scripts/gate.sh" --dry-run # print the gate's scope (the wasm-example rule included) and the commands instead of running them
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/crate_scope.py" # the crates your diff touches by their paths; `--dry-run` above shows the gate's own scope
The last run before a push is a plain gate.sh. It prints one row per step (fmt, clippy, test, hooks, python, go, lock, vocab, names, lanes): PASS, FAIL (fix and re-run), WARN (generated-sounding wording or a missing Cargo.lock change: reword or stage), SKIP (a tool you lack; CI runs that lane, so say so in the PR), INFO (the PR-title regex, the lanes this diff triggers). The clippy and test rows are scoped to the crates the diff touches: the package whose Cargo.toml is the nearest ancestor of each changed file, one -p per crate, named in the row (2 crates: smg, smg-symphony). A change to the workspace Cargo.toml, Cargo.lock, .cargo/, clippy.toml or rust-toolchain.toml widens both rows to the whole workspace, --scope workspace asks for that explicitly, and a diff under no crate skips them. The whole-workspace runs are CI's, never the gate's: rust-lint runs clippy on every crate for every pull request; rust-tests runs the test shards a pull request's paths can affect (detect-changes picks them) and every shard on main. fmt stays workspace-wide because it costs seconds. The steps follow CONTRIBUTING.md ("The pre-PR gate"), whose table still names the workspace-wide clippy and test forms: the gate scopes those two rows on the maintainers' direction, and --scope workspace gives the table's form. Without the script, run that section's commands by hand in the same order, with -p for the crates you touched. Paste the table under the PR's ## Test Plan.
The python row's harness unit tests (python3 -m pytest -q --noconftest e2e_test/infra e2e_test/fixtures) run in the python3 on PATH, the interpreter the row's two checks read before pytest. The harness's dependency set: without bash scripts/ci_install_e2e_deps.sh (pip install e2e_test/ clients/python/) every module errors at import, so the row is a SKIP naming that command. The gateway's Python package: a test file that imports smg.serve fails without the built extension (make python-dev), so the gate leaves such files out of the collection with a WARN naming them, and the row judges the harness and not the host; an import failure of any other kind is a FAIL with the error's text. CI's python-unit-tests job has both. An interpreter whose loader cannot find the system libssl builds the extension with (cd bindings/python && maturin develop --features vendored-openssl), the feature make python-build uses.
The hooks row runs SMG's hooks over every file, the unit-test layout hook among them. A package that holds a tests/unit folder keeps no unit test under src. A package in mid-move, which says so by tests/unit/MOVING.md, may still hold the tests that have not moved. skills/craft/structure.md ("Where code and tests go") has the rule. One pre-commit install sets up the pre-commit, commit-msg and pre-push hooks.
rust-tests runs each gateway integration shard a second time, with Grand Central placing the requests. The gate does not, so a gateway integration test must pass both ways.SMG_TEST_GRAND_CENTRAL=on cargo test -p smg --test <binary> (the test harness reads SMG_TEST_GRAND_CENTRAL) and python3 scripts/check_unit_test_layout.py (the hook unit-test-layout, one line a fault)..github/workflows/claude-code-review.yml gets no automatic Claude review. The workflow must match its copy on main, so the action skips with a warning. A comment's run reads the workflow from main..md or .lock files at the repository's root starts neither bot by itself (paths-ignore in both workflows): ask with the comment below.@claude review or @codex review in a comment asks for a full review (REVIEW.md, "Bots").dependabot/ branch keeps the tool's own case); regex ^([a-z0-9]([a-z0-9._-]*[a-z0-9])?(/[a-z0-9._-]+)+|dependabot/[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)+)$. SMG keeps the rule in one script, scripts/branch-name-check.sh, which its pre-push hook and its pull-request workflow both run. Never commit on main, master (pre-commit no-commit-to-branch); CI closes PRs from other branch names.type(scope): summary with type in feat, fix, chore, docs, refactor, test, ci, perf, lint, style, revert, build, lowercase scope.git commit -s; the Signed-off-by trailer must equal the commit's author, name <email> exactly (scripts/dco-check.sh reads the identity the commit is made with, so git -c user.name=... -c user.email=... commit -s passes; the DCO check and the gate's names row compare the trailer with the author afterwards). Never --no-verify.Co-authored-by or Signed-off-by line matching ^(Co-authored-by|Signed-off-by):.*(Claude|noreply@anthropic\.com) fails the no-ai-co-author hook and CI.^(feat|fix|chore|docs|refactor|test|ci|perf|lint|style|revert|build)(\([a-z0-9_./-]+\))?!?: .+.## Description, ### Problem, ### Solution, ## Changes, ## Test Plan, each filled; the review bot posts the gaps otherwise.Clippy and style rules live upstream: Cargo.toml [workspace.lints], clippy.toml, and smg-docs code-style.md. The four that surprise: #[expect(lint, reason = "...")] not #[allow]; tracing not println!; Uuid::now_v7 not new_v4; HTTP clients only through the crate's client factory, never reqwest::Client::new (the TLS provider is installed there). tokio::spawn only for tasks that may die at shutdown, justified at the call site. A fifth is Grand Central's: the guard of a decision slot is dropped before an .await (the await-holding-invalid-types list of clippy.toml names the type).
cargo fmt / clippy / test output.Cargo.toml change ships with its Cargo.lock diff (CI starts every Rust job with cargo metadata --locked).RouterConfig field ships with its Python chain (the gate runs the lane whenever config, protocols or bindings changed).smg:review-pr; run it on your own diff first, then smg:craft's review questions.## Release note section after the Test Plan. SMG's PR template now holds the section. It is one sentence on what a user gets, written to be pasted into the release page as it stands, or none with the reason. The release tool reads it from every merged PR when the notes are drafted; a PR without one costs the release author a sentence (skills/craft/release-notes.md).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pre-commit, ci-gate, rust, python, go, contribution-workflow
npx claudepluginhub smg-project/smg-dev-guide --plugin smg8 skills in this plugin
/add-modelAdd support for a new checkpoint or model family to SMG end to end. Use for "support model X", "the engine added model Y", "which models did the engine release lately", a new Symphony group row, a new media family, or new conformance rows. Decides what the checkpoint owes (a Symphony row or table, a media family, token-parity and processor-parity rows in the conformance repository) and walks one recipe per part, each step with a file, a verify command and the silent trap./craftHow SMG code is written, so a change reads like the maintainers wrote it. Use before writing non-trivial code, naming things, designing a flag, metric, endpoint or error, touching a hot path, writing a commit message, PR text, a release-note sentence, release notes or an announcement, or a doc comment, or when reviewing for cloning, bounds, duplication and wording. Points to the evidence-backed references on writing, performance, interfaces, structure and release notes./implementOther plugins' skills for the same job