Mcs lab new lab pr
Skill microsoft/BootcampLabTestPlugin/skills/mcs-lab-new-lab-pr
Open a PR on the active instance's lab repo (microsoft/mcs-labs by default) that adds a NEW lab built by mcs-lab-builder. Stages the assembled `labs/<slug>/README.md` + screenshots, applies the registration entry (root `lab-config.yml` + generator, or direct `_data/lab-config.yml` + `_labs/<slug>.md` writes — per the detected mechanism), commits everything in one commit on a run-unique branch off `origin/main`, and opens the PR. Invoked by mcs-lab-builder at B7 — NOT directly by the user. Do not use this for audit fixes (that is mcs-lab-fix-pr-filer, which patches an existing lab).From its SKILL.md
npx -y skills add microsoft/BootcampLabTestPlugin --skill mcs-lab-new-lab-prAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.8 KB, as published. Nobody here has run it
mcs-lab-new-lab-pr (sub-skill)
Open the PR for a freshly-built lab. You are called by mcs-lab-builder at B7 with: build_id, mcs_labs_repo (resolved absolute path), slug, registration_mode (generate | direct), the lab metadata + order + journeys, the optional events list, the proposal_issue.number (the In-Progress type: new-lab issue opened at B3.5, if any), and the build workspace path runtime/builds/<build-id>/. The audit gate has already passed (or the user accepted a draft PR with residual findings listed by the orchestrator).
Why a separate skill from mcs-lab-fix-pr-filer. That filer's contract is: patch an existing _labs/<slug>.md from suggested_correction diffs and replace images, with OPEN-PR-dedup keyed to a lab's audit history. A new lab has no existing markdown to patch and no findings diffs — it adds a whole folder, a registration entry, and (in generate mode) generated output. Keeping this separate preserves both skills' contracts.
Flow
-
Prepare the working tree.
cd <mcs_labs_repo> git fetch origin mainStash any unrelated in-flight changes with a labeled stash and restore them at the end — never clobber the user's uncommitted work. Record whether a stash was created.
-
Create the branch (run-unique, off fresh main).
branch = build.issues.new_lab_pr.pr_branch_pattern # default "{branch_prefix}/new-lab-{slug}-{build_id}" git checkout -b "<branch>" origin/mainThe
{build_id}suffix makes the branch unique — re-running build for the same slug yields a fresh build_id and a fresh branch, so a merged/closed prior PR never collides. (No open-PR append path: a new lab is one-shot.) -
Stage the lab content.
- Copy
runtime/builds/<build_id>/draft/README.md→<mcs_labs_repo>/labs/<slug>/README.md. - Copy
runtime/builds/<build_id>/draft/images/*→<mcs_labs_repo>/labs/<slug>/images/(create the dir; same-name copy — the README referencesimages/<file>). - These may already be staged by the B6 gate; copying is idempotent.
- Copy
-
Apply registration (per
skills/mcs-lab-builder/references/lab-registration-spec.md):- generate mode: add the one entry to the root
lab-config.yml(title,difficulty,duration,section,order,journeys, andevents: [...]only ifeventsis non-empty), then run the generator (pwsh -NoProfile -File <mcs_labs_repo>/scripts/Generate-Labs.ps1 -SkipPDFsor the path from config). Commit the generated_labs/<slug>.md+_data/lab-config.ymltoo. - direct mode (current reality): add the lab entry directly to
_data/lab-config.yml(matching the existinglab_metadata/lab_journeys/lab_ordersshape), and write_labs/<slug>.mddirectly — Jekyll frontmatter (layout: lab,title,order,duration,difficulty,section,journeys,description, plus anybootcamp_order/event keys only if attached) followed by the README body. Ifeventsis non-empty, add the slug to each event'slab_orderin_data/lab-config.yml.
- generate mode: add the one entry to the root
-
Sanity check.
git status --porcelain git diff --statIf nothing changed, abort with
pr_action: skipped_no_changesand restore the stash. (Should not happen for a real build.) -
Commit (one commit, no AI attribution).
git add labs/<slug>/ _labs/<slug>.md _data/lab-config.yml lab-config.yml # whichever exist git commit -m "<slug>: add new lab"Commit body (plain, no
Co-Authored-By/ no AI mention): one line on what the lab teaches (from Summary of Targets), the use-case list, andBuilt and verified end-to-end by mcs-lab-builder (build <build_id>).Author = currentgh/gituser. -
Push and open the PR.
git push -u origin <branch> gh pr create --repo {repo} --base main --head <branch> \ --title "<slug>: add new lab" \ --body-file "runtime/builds/<build_id>/pr-body.md"Render
pr-body.mdfirst: what the lab teaches, the UC list, the lab metadata (section/difficulty/duration/journeys, events if any), a "How it was verified" line (Built interactively and passed the mcs-lab-builder audit gate, build <build_id>), and — if the user accepted residual findings — a "Findings deferred to review" list. If aproposal_issue.numberwas passed, includeCloses #<proposal_issue.number>in the body (perbuild.proposal_issue.link_pr_with; useRefs #<n>instead if configured toRefs) so merging the lab resolves the In-Progress proposal. Usegh pr create --draftwhen residual findings exist.Closes #<n>only resolves the proposal when the PR is merged. If this PR is ever closed without merging (superseded run, abandoned build), the proposal would be orphanedIn Progress— see the close-on-PR-close rule below andskills/mcs-lab-builder/SKILL.mdB3.5, which closes such orphans on the next build run for the slug. -
Restore + record.
git switch -thengit stash popif a stash was created.- Write
runtime/builds/<build_id>/pr-url.txtand return{ pr_url, pr_action: created | created_draft | skipped_no_changes }to the orchestrator.
Rules
- Branch off fresh
origin/main, never the user's current branch (the mcs-labs clone is often on a feature branch). - One commit, no AI attribution (no
Co-Authored-By: Claude, no "Generated with…") — user preference. - Never force-push. Never touch other labs' files.
- Restore stashed work even on early abort.
- Generated output is committed in generate mode so the PR builds the site without a maintainer re-running generation.
- If you close or supersede a PR you opened (without merging it), close its linked proposal issue in the same step.
Closes #<n>fires on merge only, so a non-merge close would otherwise leave thetype: new-lab/status: in-progressproposal orphaned. Rungh issue close <proposal_issue.number> --repo {repo} --comment "Linked PR #<pr> was closed without merging."(skip whenbuild.proposal_issue.close_orphaned_on_pr_close: false). Never depend onClosesto clean up a closed-unmerged PR.