qv-sdk-update-models
Skill697 starsChanged 18 days agoApache-2.0View on GitHub
Regenerates SDK model constants from the live QVAC registry and opens a [mod] PR. Use when registry models landed and packages/sdk models.ts needs syncing, or when invoking /qv-sdk-update-models. The SDK regen also refreshes the sdk-kotlin generated contract so the mandatory Kotlin merge gate stays green; optional cascade refreshes ai-sdk-provider and sdk-python generated catalogs.
- Installs packages
- Commits and pushes
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 10 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Only needing a dry-run drift check — run npm run check-models directly.
- Very specific: line 73
No silent git mutations: Do not git switch / checkout / stash / pull / merge / rebase without explicit user instruction.
- Very specific: line 79
Prefer draft=false / Ready for review org-branch PRs when the user wants baseline CI (same preference as qv-sdk-pr-create).
- Very specific: line 86
After a successful npm run update-models in packages/sdk/:
- Distinctive: line 107
If git status shows files outside the active file set, STOP and ask.
- Very specific: line 115
Prefer QVAC-\d+ / SDK-\d+ from branch name or user message.
- Very specific: line 116
If missing and --notask was passed → use [notask].
- Very specific: line 117
If missing and no --notask → ASK for a ticket (or confirm --notask).
- Very specific: line 140
If --check-only: run Step 2 only, report, stop.
- Very specific: line 196
If --cascade or --with-provider:
- Very specific: line 216
If .venv is missing, fail-stop with the venv setup command from Prerequisites.
- Distinctive: line 217
Do not invent alternate python binaries.
- Very specific: line 221
Prefer the newest history file under packages/sdk/models/history/ whose timestamp= is from this run (or the file update-models just …
- Very specific: line 230
Bogus-history guard: if previous_count=0 and the [added] list is huge relative to a normal incremental sync (e.g.
- Distinctive: line 238
Delete empty subsections. Validator requires at least one of Added / Updated / Removed with a fenced code block.
- Distinctive: line 258
Ask: "Commit these files?" — only then:
- Very specific: line 261
Commit with the approved message (use a temp file for -F if needed.
- Distinctive: line 274
Models section: use the section built in Step 5
- Distinctive: line 285
After success, print the clickable PR URL.
- Very specific: line 293
Keep this PR to model catalog sync — don’t mix [api] / [bc] into a pure model-sync PR (combine tags with | when needed, e.g.
- Very specific: line 305
Do not re-run update-models if the tree already has a fresh regen from this session unless the user asks to re-fetch.
- Distinctive: line 307
Prefer Read/Grep tools over shell for inspecting history files and diffs.
- Distinctive: line 326
Does not upload models to the registry (that is registry/CI writer flow).
- Distinctive: line 327
Does not bump package versions or cut releases.
- Distinctive: line 328
Does not modify naming / companion / shard codegen.
- Very specific: line 329
Does not approve the fork-ci environment on fork PRs.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SDK Update Models
Regenerate @qvac/sdk static model constants from the live P2P registry, then
open a [mod] PR. Registry sync does not auto-update SDK constants — this
skill is the deliberate regen + PR path.
When to use this skill
Use when:
- New/updated/removed models landed in the production registry and SDK constants are stale.
- Someone asks to "update models", "sync models.ts", or "run update-models".
- User invokes
/qv-sdk-update-models.
Do NOT use when:
- Changing naming rules / companion detection / codegen logic (those are code changes; regen may be a follow-up, not the whole PR).
- Only needing a dry-run drift check — run
npm run check-modelsdirectly. - Releasing / changelog work — use
qv-sdk-changelogafter the[mod]PR merges.
Flags
| Flag | Behavior | |
| (none) | SDK only: packages/sdk regen + [mod] PR | |
--cascade | Also regen @qvac/ai-sdk-provider and packages/sdk-python | |
--with-provider | Cascade provider only | |
--with-python | Cascade python only (usually after SDK contract:export) | |
--check-only | Run check-models and report; do not write or open a PR | |
--no-pr | Regen + commit plan only; skip PR creation | |
--notask | Allow `feat[mod | notask]: …` when no ticket is available |
Combine as needed: /qv-sdk-update-models --cascade, /qv-sdk-update-models --check-only.
The SDK regen always refreshes the packages/sdk-kotlin generated contract — its
checkContract is a required merge gate on packages/sdk/contract, so a model
sync that skipped it would be born stale and fail the gate. --cascade adds the
provider and python catalogs on top of that.
Prerequisites
- Working directory is the
qvacmonorepo root (or resolve paths from it). - Network access to the live registry (Hyperswarm / Hyperdrive).
packages/sdkdependencies installed (npm installin that package if needed).- Optional:
QVAC_REGISTRY_CORE_KEYto target a non-default registry core. python3on PATH for the always-run Kotlin contract regen. The generator atpackages/sdk-kotlin/scripts/generate-contract.pyuses only the standard library — no venv, no pip install.- For
--with-python/--cascade:packages/sdk-python/.venvwith gen extras (python3 -m venv .venv && .venv/bin/pip install -e ".[gen,dev]"). ghCLI for PR creation (same expectations asqv-sdk-pr-create).
Secrets: this skill only needs registry network access. It does not read
GH_TOKEN / HF_TOKEN / NPM_TOKEN unless a chained skill does.
Safety rules
- Plan-then-apply. Print the planned commands and expected file set; wait for
explicit user confirmation before regen, commit, push, or
gh pr create. - No silent git mutations. Do not
git switch/checkout/stash/pull/merge/rebasewithout explicit user instruction. - Fail-stop on unexpected dirty files, missing tools, or registry errors.
- Do not edit
naming.ts, companion logic, schemas, or hand-written API code. If those need changes, stop and tell the user this skill is the wrong tool. - Prefer draft=false / Ready for review org-branch PRs when the user wants
baseline CI (same preference as
qv-sdk-pr-create).
Expected file sets
SDK (always)
After a successful npm run update-models in packages/sdk/:
packages/sdk/models/registry/models.tspackages/sdk/models/history/<short-sha>.txt(only when add/update/remove)packages/sdk/contract/models.json(via chainedcontract:export)- Possibly other
packages/sdk/contract/*if export rewrites them — include ifgit statusshows them; do not invent diffs. packages/sdk-kotlin/src/commonMain/kotlin/io/tether/qvac/sdk/generated/Models.kt(via the always-run Kotlin regen). Othergenerated/**files only if the export also changed schema inputs — include ifgit statusshows them.
Provider (--with-provider / --cascade)
packages/ai-sdk-provider/src/models/constants.tspackages/ai-sdk-provider/models/history/<short-sha>.txt(when delta exists)
Python (--with-python / --cascade)
packages/sdk-python/src/tetherto/qvac_sdk/_generated/models_registry.py- Other
_generated/**files ifgenerate.pyrewrites them — include if dirty.
If git status shows files outside the active file set, STOP and ask.
Workflow
Step 0 — Parse flags and resolve ticket
- Parse flags from the user message.
- Ticket:
- Prefer
QVAC-\d+/SDK-\d+from branch name or user message. - If missing and
--notaskwas passed → use[notask]. - If missing and no
--notask→ ASK for a ticket (or confirm--notask).
- Prefer
Step 1 — Preflight (read-only)
From monorepo root:
git status -sbandgit status --porcelain.- Allowed dirty paths before regen: none, or only files already in the expected file set from a prior interrupted run of this skill.
- Confirm remotes (
git remote -v) for later PR push (org remote preferred). - Print plan:
Plan:
1. npm run check-models (packages/sdk)
2. npm run update-models (packages/sdk) [needs confirm]
3. [optional] provider / python cascade
4. commit feat[mod] …
5. open PR via qv-sdk-pr-create
Ticket: …
Cascade: none | provider | python | both- If
--check-only: run Step 2 only, report, stop. - Otherwise ask: "Proceed with regen?" — wait for yes.
Step 2 — Drift check
cd packages/sdk
npm run check-models| Exit | Meaning | Action |
| 0 | Up to date | Report "already synced" and stop (unless user still wants cascade-only — ask) |
| 1 | Drift / timeout / error | Read stdout. If it lists new/updated/removed models, continue. If timeout/error, fail-stop |
| other | Unexpected | Fail-stop |
Capture Added / Updated / Removed names from the check output when present — useful if history later looks bogus.
Step 3 — Regenerate SDK
After user confirmation:
cd packages/sdk
npm run update-modelsThen:
cd packages/sdk
npm run contract:checkcontract:check must pass (update-models already ran export; this verifies).
Then refresh the Kotlin generated contract from the same packages/sdk/contract
artifacts and verify it (from monorepo root):
python3 packages/sdk-kotlin/scripts/generate-contract.py
python3 packages/sdk-kotlin/scripts/generate-contract.py --checkThis is not optional: checkContract is a required merge gate, so the Kotlin
Models.kt must track contract/models.json in the same PR. A pure model sync
touches only Models.kt; if git status shows other generated/** files, the
export also changed schema inputs — include them, do not revert.
Inspect git status. Confirm only the SDK expected file set is dirty.
Step 4 — Optional cascade
Provider
If --cascade or --with-provider:
cd packages/ai-sdk-provider
npm run update-modelsNote: provider filters engines without OpenAI-shaped endpoints (e.g. VAD). A smaller delta than SDK is expected.
Python
If --cascade or --with-python:
cd packages/sdk-python
.venv/bin/python3 scripts/generate.py
.venv/bin/python3 scripts/generate.py --checkIf .venv is missing, fail-stop with the venv setup command from Prerequisites.
Do not invent alternate python binaries.
Step 5 — Build the Models section
Prefer the newest history file under packages/sdk/models/history/ whose
timestamp= is from this run (or the file update-models just printed).
Parse sections:
[added]→ ### Added models[updated]→ ### Updated models[removed]→ ### Removed models
Bogus-history guard: if previous_count=0 and the [added] list is huge
relative to a normal incremental sync (e.g. hundreds of names when check-models
only reported a handful), do not paste the full history dump into the PR.
Fall back to:
- Names printed by
check-models/update-modelsconsole output, or - Diff-derived constant names from
git diffon export lines inmodels.ts
Delete empty subsections. Validator requires at least one of Added / Updated / Removed with a fenced code block.
Step 6 — Commit (human-gated)
Present:
- Proposed commit message
- File list to stage
Default message shapes:
feat[mod]: sync model constants from registryWith ticket in branch/PR title later; commit format is prefix[tags]: subject
(no ticket in commit). If the user wants the ticket in the commit subject, still
keep valid commit format (ticket belongs in the PR title).
Ask: "Commit these files?" — only then:
- Stage exactly the expected dirty files.
- Commit with the approved message (use a temp file for
-Fif needed; follow repo bash rules when operating in constrained shells). git statusto verify clean expected state.
Step 7 — Open PR (unless --no-pr)
Chain into qv-sdk-pr-create (read that skill and follow it), with these
overrides already decided:
- Tag:
[mod]required - Prefix: usually
feat - Title:
TICKET feat[mod]: sync model constants from registry(orfeat[mod|notask]: …when--notask) - Models section: use the section built in Step 5
- What problem: registry has newer models than the committed SDK catalog; consumers need updated compile-time constants
- How it solves: regenerated
models.ts(+ contract / cascade artifacts) vianpm run update-models - Testing:
npm run check-models(exit 0 after regen);npm run contract:check;python3 packages/sdk-kotlin/scripts/generate-contract.py --check; note cascade checks if run
Still ask before git push / gh pr create (pr-create’s confirmation step).
After success, print the clickable PR URL.
Commit / PR format reminders
- Commits:
feat[mod]: subject - PRs:
QVAC-123 feat[mod]: subjectorfeat[mod|notask]: subject [mod]body must include## 📦 Modelswith at least one of Added / Updated / Removed (fenced constant names, one per line)- Keep this PR to model catalog sync — don’t mix
[api]/[bc]into a pure model-sync PR (combine tags with|when needed, e.g.[mod|notask])
Validate locally when useful:
node scripts/sdk/validator.cjs --type=commit --msg="feat[mod]: sync model constants from registry"Efficiency rules
- Bound shell calls (~8–12 for a full cascade + PR). Cache
git status/ remotes. - Do not re-run
update-modelsif the tree already has a fresh regen from this session unless the user asks to re-fetch. - Prefer Read/Grep tools over shell for inspecting history files and diffs.
Quality checklist
Before reporting done:
- User confirmed regen (and commit / PR when applicable)
npm run check-modelsexits 0 after regen (re-run once to confirm)npm run contract:checkexits 0python3 packages/sdk-kotlin/scripts/generate-contract.py --checkexits 0- Dirty files ⊆ expected file set for the flags used
- History/Models section is incremental — not a bogus full-catalog dump
- Cascade checks passed when flags requested
- Commit message and PR title pass format rules
- PR URL printed (unless
--no-pr/--check-only) - Provenance: PR body or chat notes that
/qv-sdk-update-modelsproduced the work
What this skill does NOT do
- Does not upload models to the registry (that is registry/CI writer flow).
- Does not bump package versions or cut releases.
- Does not modify naming / companion / shard codegen.
- Does not approve the
fork-cienvironment on fork PRs.
References
- Script entry:
packages/sdk/package.json→update-models/check-models - Implementation:
packages/sdk/models/update-models/ - Knowledge:
packages/ocr-ggml/.agent/knowledge/registry-models.md(Step 4) - Model constants docs:
packages/sdk/docs/model-constants-and-sources.md - PR format:
docs/gitflow.mdand.agents/skills/qv-sdk-pr-create/SKILL.md - PR create:
.agents/skills/qv-sdk-pr-create/SKILL.md - Provider codegen:
packages/ai-sdk-provider/models/update-models/README.md - Python codegen:
packages/sdk-python/scripts/generate.py - Kotlin codegen:
packages/sdk-kotlin/scripts/generate-contract.py(checkContractinpackages/sdk-kotlin/build.gradle.ktsruns it with--checkas a merge gate) - Remote-mutation policy:
AGENTS.md
In this repository56 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/agent-integrations.mdcCursor rule
- .cursor/rules/cpp/string-api-conventions.mdcCursor rule
- .cursor/rules/devops/main.mdcCursor rule
- .cursor/rules/no-remote-code-execution.mdcCursor rule
- .cursor/rules/qip-triage.mdcCursor rule
- .cursor/rules/sdk/commit-and-pr-format.mdcCursor rule
- .cursor/rules/sdk/error-handling.mdcCursor rule
- .cursor/rules/sdk/first-class-product-parity.mdcCursor rule
- .cursor/rules/sdk/main.mdcCursor rule
- .cursor/rules/sdk/public-constants-contract.mdcCursor rule
- .cursor/rules/sdk/request-lifecycle-primitives.mdcCursor rule
- .cursor/rules/sdk/sdk-pod-packages.mdcCursor rule
- .cursor/rules/sdk/skill-authoring-guidelines.mdcCursor rule
- cpp-string-api-reviewSkill
- qv-addon-changelogSkill
- qv-addon-pr-createSkill
- qv-addon-release-notesSkill
- qv-agent-stack-syncSkill
- qv-asana-syncSkill
- qv-daily-work-updateSkill
- qv-dev-diary-setupSkill
- qv-dev-diarySkill
- qv-devops-daily-updateSkill
- qv-devops-pr-createSkill
- qv-devops-pr-reviewSkill
- qv-devops-pr-statusSkill
- qv-devops-runner-queueSkill
- qv-devops-why-my-pr-notSkill
- qv-docs-solution-createSkill
- qv-docs-updateSkill
- qv-holepunch-devSkill
- qv-merge-guard-wireSkill
- qv-mobile-test-dispatchSkill
- qv-notice-generateSkill
- qv-pr-mineSkill
- qv-pr-reviewSkill
- qv-pr-testSkill
- qv-qip-createSkill
- qv-qip-reviewSkill
- qv-qip-triageSkill
- qv-quality-reportingSkill
- qv-registry-autobase-patternsSkill
- qv-release-trainSkill
- qv-sdk-backmergeSkill
- qv-sdk-changelogSkill
- qv-sdk-e2e-createSkill
- qv-sdk-inference-versionSkill
- qv-sdk-pr-createSkill
- qv-sdk-pr-statusSkill
- qv-skill-listSkill
- setupSkill
- setupSkill
- qv-nx-ciSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

