--- name: ai-agents-generation-and-release description: "Operate ai-agents generators, drift gates, plugin manifests, and npm release. Use when you say `regenerate the mirrors`, `run the drift checks`, or `why is the plugin version gate red`, or before changing a generator. Do NOT use for environment setup (use `ai-agents-build-and-env`) or architecture rationale (use `ai-agents-architecture-contract`)." version: 1.0.0 license: Apache-2.0 metadata: distribution: repo-local routing: role: conditional-adjunct invoker: ai-agents-build-and-env trigger: build-and-env redirects release work here user-facing: false --- # ai-agents Generation and Release Runbook for the build, generation, mirroring, versioning, and release machinery. Facts that change (generator list, owned prefixes, skill counts, gate wiring) come from the script in Phase 1, not from this prose. Reached from `ai-agents-build-and-env`, which names this skill back. No root router exists; enter by trigger phrase. Jargon, defined once: - Generator: a Python function or script that reads a canonical tree and writes a derived (generated) tree. - Drift: the generated tree no longer matches what the generators would produce from the canonical tree. - Canonical: the tree you are allowed to edit. Generated trees are outputs; you never hand-edit them. - Semver: semantic version string MAJOR.MINOR.PATCH. The plugin manifests carry no version at all (ADR-092); the npm package still does. ## Triggers Before changing a generator or a customer-facing generated artifact, read [generated-artifacts](references/rule-generated-artifacts.md). - `regenerate the mirrors` - `run the drift checks` - `why is the plugin version gate red` - `release the npm cli` - `why is the drift gate red` ## When NOT to Use This Skill | You want | Use instead | |----------|-------------| | Set up the dev environment, uv, hooks | `ai-agents-build-and-env` | | WHY the seam is shaped this way, invariants | `ai-agents-architecture-contract` | | Triage a red CI gate you do not understand | `ai-agents-debugging-playbook` | | Change classification, commit caps, review gates | `ai-agents-change-control` | | Escape hatches like the drift allowlist | `ai-agents-config-catalog` | ## Process ### Phase 1: Know the Seam Before You Edit The generation seam is ASYMMETRIC (ADR-072, accepted and not yet implemented, refines it; the running system is what follows). Find your file BEFORE editing. Editing a generated tree is the classic failure (see Anti-Patterns). ```bash ( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/ai-agents-generation-and-release/scripts/generator_inventory.py --repo . path ; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 ) ( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/ai-agents-generation-and-release/scripts/generator_inventory.py --repo . generators; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 ) ( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/ai-agents-generation-and-release/scripts/generator_inventory.py --repo . skills; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 ) ``` - `path` answers which tree is canonical for a repo path and what regenerates it, from `templates/platforms/binplace.yaml` rows plus `OWNED_PREFIXES`. Exit 1 means no row covers the path. It does not see hand-maintained exceptions inside a generated tree, such as a shipped skill's `scripts/` and `references/`. - `generators` prints the `GENERATORS` order from `build/scripts/build_all.py`, the `OWNED_PREFIXES` tuple, and the exit-2 producer count its docstring states. Order is load-bearing. - `skills` counts `templates/skills/*.SKILL.md.tmpl` and lists the `distribution: repo-local` skills. It does not say which are shipped to a given plugin root. Rules that hold across the rows (the tables are in [references/seam-tables.md](references/seam-tables.md)): - Edit `templates/` and the `scripts/{hook_utilities,github_core,ai_review_common}` packages. Everything under `src/copilot-cli/`, `src/vs-code-agents/`, `.github/instructions/`, and `src/claude/{agents,rules,hooks,settings.json}` is generated. - Edit a skill's `SKILL.md` only through `templates/skills/.SKILL.md.tmpl` (ADR-108, ADR-109 B3). `.claude/skills/` links to `src/claude/skills/` for shipped skills (ADR-119). A repo-local skill renders straight to `.claude/skills//`. - `build_all.py` exits 2 with `REQ-003-010 VIOLATION` if a generator writes under `.claude/`, except through a `binplace.yaml` `install_tree`. Regenerating reproduces that exit; it is a policy violation, not staleness. ### Phase 2: Regenerate After Editing a Canonical Surface Commit the canonical edit and the regenerated output TOGETHER, or the drift gates go red. Interpreter: `build/generate_agents.py` and `build_all.py` import PyYAML through `build/scripts/yaml_loader.py`. Run them as `uv run python