AGENT SKILL

新实验室PR提交

mcs-lab-new-lab-pr

在当前活跃实例的实验室仓库(默认为 microsoft/mcs-labs)上开一个 PR,新增一个由 mcs-lab-builder 构建的实验室。暂存组装好的 `labs/<slug>/README.md` + 截图,应用注册条目(根目录下的 `lab-config.yml` + generator,或直接写入 `_data/lab-config.yml` + `_labs/<slug>.md`——根据检测到的机制而定),在一个基于 `origin/main` 的 run 唯一分支上将所有内容用一个提交提交,并创建 PR。由 mcs-lab-builder 在 B7 阶段调用——不由用户直接调用。请勿将其用于审计修复(那是 mcs-lab-fix-pr-filer 的职责,用于修补现有实验室)。

License 许可
MIT
最近更新
2026-06-20
Stars
★ 1
Forks
2

01 前言 Front Matter

name
mcs-lab-new-lab-pr
description
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).
allowed-tools
[ "Read", "Glob", "Grep", "Write", "Edit", "PowerShell", "Bash(git*)", "Bash(gh pr create:*)", "Bash(gh pr list:*)", "Bash(gh pr comment:*)" ]

02 资源文件 3

03 SKILL.md 正文

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

  1. Prepare the working tree.

    cd <mcs_labs_repo>
    git fetch origin main
    

    Stash 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.

  2. 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/main
    

    The {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.)

  3. 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 references images/<file>).
    • These may already be staged by the B6 gate; copying is idempotent.
  4. 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, and events: [...] only if events is non-empty), then run the generator (pwsh -NoProfile -File <mcs_labs_repo>/scripts/Generate-Labs.ps1 -SkipPDFs or the path from config). Commit the generated _labs/<slug>.md + _data/lab-config.yml too.
    • direct mode (current reality): add the lab entry directly to _data/lab-config.yml (matching the existing lab_metadata / lab_journeys / lab_orders shape), and write _labs/<slug>.md directly — Jekyll frontmatter (layout: lab, title, order, duration, difficulty, section, journeys, description, plus any bootcamp_order/event keys only if attached) followed by the README body. If events is non-empty, add the slug to each event's lab_order in _data/lab-config.yml.
  5. Sanity check.

    git status --porcelain
    git diff --stat
    

    If nothing changed, abort with pr_action: skipped_no_changes and restore the stash. (Should not happen for a real build.)

  6. 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, and Built and verified end-to-end by mcs-lab-builder (build <build_id>). Author = current gh/git user.

  7. 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.md first: 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 a proposal_issue.number was passed, include Closes #<proposal_issue.number> in the body (per build.proposal_issue.link_pr_with; use Refs #<n> instead if configured to Refs) so merging the lab resolves the In-Progress proposal. Use gh pr create --draft when 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 orphaned In Progress — see the close-on-PR-close rule below and skills/mcs-lab-builder/SKILL.md B3.5, which closes such orphans on the next build run for the slug.

  8. Restore + record.

    • git switch - then git stash pop if a stash was created.
    • Write runtime/builds/<build_id>/pr-url.txt and 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 the type: new-lab / status: in-progress proposal orphaned. Run gh issue close <proposal_issue.number> --repo {repo} --comment "Linked PR #<pr> was closed without merging." (skip when build.proposal_issue.close_orphaned_on_pr_close: false). Never depend on Closes to clean up a closed-unmerged PR.

04 同仓库更多 Skills

microsoft
microsoft/BootcampLabTestPlugin

实验室审计 PR 截图追加

mcs-lab-pr-appender

将实验室审计运行产生的截图更新追加到活动实例的 lab 仓库(默认为 microsoft/mcs-labs)中一个已存在的开放修复 PR 分支上。就地替换匹配的图片文件,仅创建一个提交,推送,并在 PR 上发表评论。永不创建新分支,也永不开启新 PR。默认情况下,当 (a) 编排器的现有状态探测发现该 slug 存在开放的 PR 且 (b) 实验室产生了新的截图产物时,由 mcs-lab-auditor 调用。可通过 --no-update-screenshots / --no-append-to-pr(CLI)或 `issues.pr_append.enabled_by_default: false`(配置)来禁用。不应由用户直接调用。

软件开发工程师代码仓库协作管理
★ 1
microsoft
microsoft/BootcampLabTestPlugin

实验室审计问题提交

mcs-lab-issue-filer

将某个实验室的 findings.json 转换为 GitHub issue 正文,并针对当前活跃实例的实验室仓库(默认为 microsoft/mcs-labs)提交该 issue。检查是否存在带有匹配标签的现有开放 issue,若有则在其上评论,而不是重复提交。由 mcs-lab-auditor 在某个实验室完成且至少有一条由 judge 记录、置信度高于阈值的发现后调用。不应由用户直接调用——它期望一个完整填充的 run 目录,并假设编排器已经过滤掉 cannot_verify 和低于阈值的发现。

测试工程师工单与问题跟踪管理
★ 1
microsoft
microsoft/BootcampLabTestPlugin

实验室审计修复PR提交

mcs-lab-fix-pr-filer

当 mcs-lab-issue-filer 已为某个实验室提交(或评论)审计 issue 后,将 findings 中建议的 suggested_correction 差异应用到实验室 markdown 文件,并把任何 proposed_screenshot_replacement 提议的截图复制到 labs/<slug>/images/ 目录。如果该 slug 已存在 OPEN 状态的修复 PR(同一作者、可合并),则向该 PR 追加提交;否则在一个 run 唯一的分支 `{branch_prefix}/fix-<slug>-content-audit-<run-id>` 上新建一个 PR。标题为 `<slug>: fix audit findings from #<issue-number>`,正文为 `Closes #<issue-number>`。去重仅针对 OPEN 状态的 PR——已合并或已关闭的历史 PR 不会阻止新建 PR。不应由用户直接调用——编排器会在 mcs-lab-issue-filer 返回 issue 编号后调用它。

软件开发工程师代码仓库协作管理
★ 1
microsoft
microsoft/BootcampLabTestPlugin

Copilot Studio 实验构建

mcs-lab-builder

以交互式方式端到端地为 mcs-labs 仓库构建新的 Microsoft Copilot Studio 实验(lab)。获取研讨会测试账号,使用 Playwright 打开 Copilot Studio 主页,然后逐步录制实验内容——编写操作说明、提示和截图,并与用户逐步确认——将其组装成与同级实验格式一致的 `labs/<slug>/README.md`,把完成的实验通过现有审核引擎重新运行作为质量门禁,并在当前实例的实验仓库(默认为 microsoft/mcs-labs)上提交 PR。该流程与具体活动/研讨会无关:实验独立构建和测试,是否关联活动为可选项。当用户说“构建新实验”、“编写实验”或调用 `/build-lab` 时使用。

软件开发工程师低代码应用开发
★ 1
microsoft
microsoft/BootcampLabTestPlugin

Copilot Studio 实验审计

mcs-lab-auditor

针对任意活动或研讨会,对 Microsoft Copilot Studio 实验(labs)进行端到端审计。动态解析 mcs-labs 仓库位置(按需克隆/更新),从仓库的 `_events/` 和 `_workshops/` 集合中枚举可审计范围,使用 Playwright 逐步执行所选范围内每个实验的所有编号步骤,并通过 LLM 评审器将实时 UI 与书面说明进行比对;然后要么提交一个 GitHub issue(每个有发现问题的实验一个),要么向本地审计日志追加一条通过记录。当用户说 "audit the bootcamp"、"audit a workshop"、"run the lab auditor"、"test the mcs-labs labs",或调用此插件中的任意 `/audit-*` 命令时,使用此技能。

测试工程师测试与质量保障
★ 1