75 minutes · VS Code + GitHub Copilot app

Lab 1: /commands + Spec Kit

Use the built-in slash commands that keep an agent grounded in your code, then build a feature the spec-driven way with GitHub Spec Kit: constitution, specify, clarify, plan, tasks, implement, converge.

Watch the walkthroughsSet up firstDownload the lab (ZIP)

Watch first: 6 walkthroughs

Illustrative reenactment - not a recorded Copilot session. Test results are real fixture runs. Select a poster to play it full screen.

Illustrative walkthrough: Explain first. Plan a contained repair. Ask for source evidence and an approved scope before any implementation.
Illustrative GIF · Before · After · Transcript

GIF 1 · VS Code | Local Chat

Explain first. Plan a contained repair.

  1. /explain
  2. /plan

Ask for source evidence and an approved scope before any implementation.

Real starter check: 3/7. This flow stops before any code changes.

Illustrative walkthrough: Make tests red. Fix the cause. Prove green. Useful tests fail on the starter and pass on the repair; the lab checks both.
Illustrative GIF · Before · After · Transcript

GIF 2 · VS Code | Local Agent Chat

Make tests red. Fix the cause. Prove green.

  1. /tests
  2. /fix

Useful tests fail on the starter and pass on the repair; the lab checks both.

Real reference acceptance: 7/7 pass, exit 0.

Illustrative walkthrough: Review the change. Challenge it. Manage context. The app has its own built-ins; /tests and /fix are not promised app commands.
Illustrative GIF · Before · After · Transcript

GIF 3 · GitHub Copilot app | local Interactive session

Review the change. Challenge it. Manage context.

  1. /review
  2. /rubber-duck
  3. /context
  4. /compact

The app has its own built-ins; /tests and /fix are not promised app commands.

Real reference acceptance: 7/7 pass, exit 0.

Illustrative walkthrough: Constitution, specification, clarification. Resolve stacking, rounding and expiry before design or code; app skills use /speckit-*.
Illustrative GIF · Before · After · Transcript

GIF 4 · VS Code | official Spec Kit commands layout

Constitution, specification, clarification.

  1. /speckit.constitution
  2. /speckit.specify
  3. /speckit.clarify

Resolve stacking, rounding and expiry before design or code; app skills use /speckit-*.

Real starter check: 2/10. This flow stops before any code changes.

Illustrative walkthrough: Plan, checklist, tasks, consistency analysis. A requirements checklist is not a runtime test. Resolve contradictions before implementation.
Illustrative GIF · Before · After · Transcript

GIF 5 · VS Code | official Spec Kit commands layout

Plan, checklist, tasks, consistency analysis.

  1. /speckit.plan
  2. /speckit.checklist
  3. /speckit.tasks
  4. /speckit.analyze

A requirements checklist is not a runtime test. Resolve contradictions before implementation.

Real starter check: 2/10. This flow stops before any code changes.

Illustrative walkthrough: Implement agreed tasks. Converge. Verify. Spec Kit reviews completeness; independent checks and the human-reviewed diff establish the final evidence.
Illustrative GIF · Before · After · Transcript

GIF 6 · VS Code | official Spec Kit commands layout

Implement agreed tasks. Converge. Verify.

  1. /speckit.implement
  2. /speckit.converge

Spec Kit reviews completeness; independent checks and the human-reviewed diff establish the final evidence.

Real reference acceptance: 10/10 pass, exit 0.

Goal: use slash commands as checkpoints rather than shortcuts, and agree on a specification before any code is written. You practice on deliberately broken code. An independent checker decides when you are done, not the model.

Part Time Workspace You invoke
A. Built-in /commands 25-35 min work\builtins VS Code: /explain, /plan, /tests, /fix, /compact. Copilot app: /plan, /review, /rubber-duck, /context, /compact
B. Spec Kit development 40-55 min work\spec-kit (VS Code) or work\spec-kit-skills (app) /speckit.constitution ... /speckit.converge (VS Code) or /speckit-constitution ... (app)

Set up first: follow the environment guide. Watch the six Lab 1 GIFs on the workshop site before each part.

These are real commands provided by your client or installed by the official Spec Kit CLI. This lab installs no homemade /clarify or /verify prompts.

Part A: built-in /commands

Scenario: src/cart.mjs ignores the quantity of each line. The agent must explain it, plan a contained repair, prove the bug with failing tests, fix only the cause, and show fresh evidence.

npm.cmd run setup -- builtins
code -n .\work\builtins

Then, from the workspace terminal:

npm.cmd run check -- --baseline

Expect 3/7 pass, 4 intended failures, BASELINE CONFIRMED, not solved.

In VS Code

Send each message separately and review the result before the next one. Use Ask/Plan for read-only steps; switch to Agent (still Local) for edits.

  1. Explain with evidence (no edits)

    /explain Read BRIEF.md and src/cart.mjs. Explain the quantity bug with file:line evidence. List the existing API and unknowns. Do not edit files.
    
  2. Plan the smallest repair

    /plan Read BRIEF.md. Propose the smallest cart repair. Only src/cart.mjs and src/cart.test.mjs may change. Cite the root cause and propose boundary tests. Do not implement yet.
    
  3. Make tests red first

    /tests Add at least four node:test cases to src/cart.test.mjs, importing ./cart.mjs. Cover existing behavior, quantity greater than one, invalid input and safe integer cents. Do not change src/cart.mjs. Run npm test and report the observed failures.
    

    Stop: the new tests must fail while the bug still exists. If they all pass, reject them and ask for the missing boundary cases.

  4. Fix the cause, not the tests

    /fix Repair src/cart.mjs against BRIEF.md and the failing tests. Keep its public API and src/legacy-pricing.mjs unchanged. No dependencies. Run npm test and npm run check; report both exit codes and any unresolved issue.
    
  5. Save evidence, then compact. After you save the brief, your decisions and the real test output, try /compact. Reattach BRIEF.md and ask the agent to restate scope and unresolved work. Compaction does not prove correctness.

In the GitHub Copilot app

Add work\builtins as a local repository and start an Interactive session.

  1. Use /plan with the same plan prompt as above. Approve it.

  2. Ask in plain chat for red tests, then for the repair. The app has no documented /tests or /fix command, so do not invent equivalents.

  3. Once the session has changes, critique them:

    /review
    
    /rubber-duck Challenge the cart repair against BRIEF.md. Look for missed boundaries, tests that also pass on the original implementation, and out-of-scope changes. Do not edit.
    
  4. Inspect /context, then try /compact.

Finish Part A: prove it yourself

npm.cmd test
npm.cmd run check
git --no-pager diff
git --no-pager status --short

You need VERIFIED: 7/7, exit 0. The checker also runs your tests against the original broken code: a suite that passes on both fails the lab. Review untracked test files too, because git diff does not show them.

Part B: Spec Kit development

Scenario: "Support discount codes" leaves stacking, rounding and expiry undecided. Spec Kit makes you settle them in a specification, plan and task list before the agent writes code.

Return to the lab directory (not the Part A workspace) and pick your client:

Client Setup Command names
VS Code npm.cmd run setup -- spec-kit then code -n .\work\spec-kit Dotted prompt commands: /speckit.specify
Copilot app npm.cmd run setup -- spec-kit-skills, then add work\spec-kit-skills as a local repository Hyphenated skills: /speckit-specify (run /skills reload if needed)

Setup runs the official, pinned specify-cli==1.2.3 in isolation. It never touches a global specify.

specify init <workspace> --integration copilot --integration-options="--commands --events false" --script ps --non-interactive --ignore-agent-tools

The app track uses --skills instead of --commands. macOS/Linux uses --script sh. Setup verifies the nine installed workflow entries.

Baseline from the workspace terminal: 2/10 pass, 8 intended failures.

The nine steps, one message at a time

The examples use the VS Code dotted names. In the app, replace the dot with a hyphen, for example /speckit-clarify.

  1. Constitution: fix the project's rules once.

    /speckit.constitution Keep the public API and catalogue stable. Use integer cents, no dependencies, and node:test. Reproduce defects with red regression tests. Reject invalid input explicitly. Require real terminal verification and no unrelated edits.
    
  2. Specify: say what checkout must do, not how.

    /speckit.specify Make discount-code checkout correct for the existing project in BRIEF.md. Capture the discount policy and measurable acceptance criteria before implementation. Do not change code yet.
    
  3. Clarify: answer from BRIEF.md. Do not let the agent silently pick stacking, rounding or expiry rules.

    /speckit.clarify Resolve stacking, duplicate codes, integer-cent rounding, unknown codes, inclusive expiry and explicit dates against BRIEF.md. Ask the blocking questions before planning.
    
  4. Plan: reuse the existing code.

    /speckit.plan Use the existing Node.js ESM project, node:test and src/coupons.mjs. No dependencies or new services. Preserve quoteDiscount(subtotalCents, codes, today). Plan tests that fail on the original implementation before repairing it.
    
  5. Checklist: review the quality of the requirements, not the code.

    /speckit.checklist Review whether stacking, duplicate handling, cent precision, expiry, invalid input and frozen scope are complete, clear and testable. Do not treat this as a passing code test.
    
  6. Tasks: ordered, requirement-linked work items.

    /speckit.tasks Include at least four node:test cases in src/discount.test.mjs importing ./discount.mjs. Run them red before fixing src/discount.mjs, then run npm test and npm run check.
    
  7. Analyze: find contradictions between spec, plan and tasks. Fix material findings in those documents and rerun before you build.

    /speckit.analyze
    
  8. Implement: approve only the agreed scope.

    /speckit.implement Follow the agreed tasks. Preserve the API and catalogue; change only src/discount.mjs and src/discount.test.mjs plus the Spec Kit feature documents. Run and report the red tests before the repair and the independent checks afterward.
    
  9. Converge: check that everything is complete, then verify.

    /speckit.converge
    

Finish Part B: prove it yourself

npm.cmd test
npm.cmd run check
git --no-pager diff
git --no-pager status --short

You need VERIFIED: 10/10, exit 0. The checker verifies the policy, regressions that fail on the original code, the unchanged catalogue, and a constitution plus spec.md, plan.md and tasks.md for one feature. Files existing is not proof of quality, so read them and the diff.

Spec Kit records the active feature in .specify/feature.json, not only the Git branch. This lab expects exactly one feature.

Stop and correct when

  • The agent edits during /explain, /plan or /speckit.clarify.
  • New tests pass on the broken code.
  • The agent says "all tests pass" without a real command and exit code.
  • A Spec Kit checklist gets ticked without review. A checklist box is not a passing test.
  • A change touches the catalogue, legacy pricing, dependencies or the checker.

Evidence to keep

  • Root cause with file:line before any edit
  • Agreed scope or clarified specification before implementation
  • A red test run before the repair
  • Fresh VERIFIED: 7/7 (Part A) and VERIFIED: 10/10 (Part B), exit 0
  • Reviewed diff, including untracked files
  • Any limitation stated honestly

References

Next: Lab 2: anti-slop skills.