---
name: stage-builder
description: "Design a custom USPSA-style practical-shooting stage from scratch via interview + iterative authoring in the Stage Setter web editor at https://itsmatchday.app/build/. Begins by asking the user 4 calibration questions (difficulty, round count, movement style, master-shooter design philosophy), then plans a stage that combines those answers with USPSA safety rules + the principles in references/master_principles.md, builds it incrementally in the editor with screenshots between chunks, and iterates based on critique until the user accepts. Saves the final JSON to ~/Desktop/ or ~/Downloads/ per user preference. Use this skill when the user says anything like 'build me a stage', 'design a stage', 'create a field course', 'stage builder', 'let's design a stage', 'new field course', or asks for an original practical-shooting course (NOT a USPSA classifier — CM-XX-YY classifiers have specific official geometry and should be transcribed from the PDF spec directly, not generated from interview answers)."
---

# Stage Builder

End-to-end workflow for designing an original USPSA-style practical-shooting stage by interviewing the user, planning against master-shooter design principles, and authoring the stage in the Stage Setter web editor with safety-aware geometry.

## When to invoke

Trigger phrases:
- "Build me a stage" / "design a stage" / "create a stage"
- "Let's design a field course" / "new field course"
- "Stage builder" / "use the stage builder"
- "Make a practical shooting stage"

**Do NOT invoke for USPSA classifier authoring** (`CM XX-YY` codes from a PDF) — those have specific official geometry and should be transcribed from the PDF spec directly. This skill is for free-form original stage design only.

## Pipeline overview

```
Interview (4 questions via AskUserQuestion)
  → Plan (combine answers + master principles + safety rules)
  → Start editor preview, clear canvas, set bay dimensions
  → Build geometry in chunks: center targets → side targets → walls → fault polygon → start mark
  → Screenshot after each chunk; surface unexpected positions to user
  → Write Stage Brief (procedure, build notes, gotchas, safety notes)
  → Save JSON to Desktop or Downloads
  → Iterate based on critique
```

## Step 1 — Interview the user

The interview is **5 questions total**, split across **two `AskUserQuestion` calls** because the tool caps at 4 questions per call. Do the calibration batch first (4 questions), then the philosophy question (1 question with 4 options).

### Call 1 — Calibration (4 questions)

1. **Difficulty**
   - Header: `Difficulty`
   - Options: `Easy`, `Medium`, `Hard`, `Expert`
   - This drives: target distances, partial/hardcover frequency, no-shoot density, steel placement, port awkwardness.

2. **Round count**
   - Header: `Round count`
   - Options: `Short (10-12)`, `Medium (16-24)`, `Long (28-32)`
   - This drives: paper count (rounds ÷ 2), steel count, stage size.

3. **Movement style**
   - Header: `Movement`
   - Options: `Static (1-2 positions)`, `Moderate (3-4 positions)`, `Heavy (5+ positions, sprints)`
   - This drives: shooting-area shape (box vs. lanes vs. complex polygon), distance between positions, fault-line design.

4. **Symmetry**
   - Header: `Symmetry`
   - Options: `Symmetric (mirrored L/R)`, `Asymmetric (different L/R)`, `Doesn't matter`
   - Symmetric stages are clean and balanced; asymmetric ones break shooter assumptions and reward thinking. The default is no preference — pick whatever serves the design. **Stages do not have to be symmetric** — don't reflexively mirror left and right unless the user wants it or the philosophy calls for it (Miculek-style symmetric, for example).

### Call 2 — Philosophy (single question, 4 options)

5. **Design philosophy** (which master to emphasize)
   - Header: `Philosophy`
   - Options (4 max — for rhythm/cadence (Miculek-style), the user can type "Miculek" in the Other field):
     - `Mathematical / strategy / flow (Grauffel-style)`
     - `Control / accuracy traps (Leatham-style)`
     - `Explosive movement / transitions (Michel-style)`
     - `Awkward / visual chaos (Stoeger-style)`
   - Each maps to one section in `references/master_principles.md`. Use 2-3 specific principles from that section as the stage's "thesis." Optionally mix in 1 principle from another section as a wrinkle.

After both calls' answers come back, **briefly state the design thesis in 1-2 sentences** before building. Example: *"Going for an asymmetric Stoeger-style hard course with moderate movement — heavy hard-cover partials on the left, a low port on the right that forces a crouch, and a 6-yard no-shoot wall right next to a 20-yard partial. ~24 rounds, three shooting positions."*

## Step 2 — Plan against the principles + safety rules

Read both reference files (LOAD ON DEMAND, not into context unless needed):
- `references/master_principles.md` — design principles by master shooter
- `references/safety_rules.md` — USPSA shooting-area + bullet-path rules

Build a mental sketch:
- **Bay size**: default 35×40 unless the user specified or the round count demands more. Long courses with heavy movement may need 50×50.
- **Shooting area shape**: pick from the menu in `references/safety_rules.md` § "Shooting-area shapes" — box, single rectangle, lanes-with-rear-band, frame-with-cutout, multi-area with `leaveShootingArea: yes`.
- **Target distribution**: paper count ≈ rounds ÷ 2. Apportion across center / left / right / movers.
- **Target facings**: center targets face 180° (uprange, bullets into back berm). Side-room targets face 90° / 270° (east/west, bullets into side berms). Use angled facings (135° / 225°) when the natural shooter position is in a corner — explained in `references/geometry_rules.md`.
- **Walls**: place where they shape engagement decisions, NOT downrange of paper targets. Walls can serve as part of the shooting-area perimeter.
- **Fault polygon**: must enclose the shooting area on EVERY outer edge — bay berms are NOT boundaries. See `references/safety_rules.md` § "Fault-line rule".

State the plan to the user before building — they may want to redirect before code runs.

## Step 3 — Build in the editor

Follow the editor-driving recipe in `references/editor_api.md`. The high-level chunks:

1. **Start the preview server** (`preview_start name="match-day-editor"`) and navigate to the editor URL (`https://itsmatchday.app/build/`). Dismiss any "restore last session" prompt with **Start Fresh**.
2. **Set bay dimensions** via the settings dialog (gear icon).
3. **Build chunks** via `applyStageJson` round-trips. After each chunk: take a screenshot, briefly describe what was added, ask the user to flag anything wrong before continuing.
   - Chunk A: Center-room targets
   - Chunk B: Side-room targets (left, then right)
   - Chunk C: Steel and movers (if any)
   - Chunk D: Walls
   - Chunk E: Fault polygon (closed, all outer edges, see safety rules)
   - Chunk F: Start position
4. **Stage Brief** via `openBrief()`. Always include a SAFETY DESIGN NOTES paragraph in `buildNotes` that explains for each bullet trajectory family where the rounds end up.

### What "gotchas" should and shouldn't contain

The `brief-gotchas` field is for **terse RO and setup-crew reminders** — the things that, if forgotten, cause a procedural penalty, a DQ, or a build error. Examples of acceptable gotcha lines:
- "Mandatory reload between Box A and Box B — failure = 1 procedural per shot fired"
- "No-shoot NS1 touches T6 on the south edge — set them flush, not overlapping"
- "Start position requires both hands flat on barricade above the marked line"
- "Round count: 14 paper × 2 = 28 rounds"

What does NOT belong in gotchas — **never write tactical shooting advice**. The brief is a neutral RO/build document; it should not coach the shooter. Bad examples (do NOT generate):
- ❌ "Engage T7 from the left lane for the cleanest angle"
- ❌ "Slow your transitions or risk no-call splashes"
- ❌ "Walk into a lane to face-shoot the side rooms"
- ❌ "Pick the wrong first array and you'll be running back across the bay"

The shooter develops their own plan from the diagram and the procedure. The gotchas section exists only to highlight what they MUST know to avoid penalties or setup mistakes.

## Step 4 — Verify safety BEFORE saving

For every target, write out the bullet trajectory in the brief:
- Center targets facing 180° → bullets travel south into back berm.
- Left-room targets facing 90° or 135° → bullets travel west into left berm.
- Right-room targets facing 270° or 225° → bullets travel east into right berm.

Walk through each pair of "shooter position + target" combination and check:
- Does any wall sit downrange of any target in the shooter's natural firing line? If yes, **move the wall or target**.
- Does any other paper sit downrange of any target from a reachable shooter position? If yes, **stagger y-depth or x-offset to break collinearity**.

These checks aren't theoretical — they bit us repeatedly in the dev session that produced this skill (see `references/session_gotchas.md`).

## Step 5 — Save and iterate

Ask the user where they want the stage saved. If they have no preference, default to `~/Desktop/new stage designs/<CODE>_<Name>.json` (e.g., `~/Desktop/new stage designs/FC-01_ThreeDoors.json`), creating the folder if it doesn't exist.

After save, ask: *"What would you change?"* Common iterations:
- Move/rotate specific targets
- Add or remove no-shoots, hardcover, steel
- Add movers (note: editor doesn't render moving props beyond static placeholders — describe behavior in brief)
- Reshape fault polygon
- Tighten or loosen target clusters

For each iteration: apply the change as a small `applyStageJson` patch (don't rebuild from scratch), screenshot, then re-save the JSON file.

**Common iteration phrases and how to translate them** are captured in `references/session_gotchas.md` § 17 (mirror formulas, "X% more angled" interpretation, lane-width specs, target scooting, jut removal). Consult that file when the user asks for these patterns — don't re-derive each time.

## Critical safety rules (do NOT skip)

1. **Shooting area enclosed on every outer edge by fault lines or walls.** Bay berms are NOT boundaries.
2. **Targets live in DOWNRANGE TERRAIN, not inside the shooter polygon.** Place paper/steel on the OUTSIDE of every fault line. The shooter walks around the polygon; targets are everything they look AT, not stand among. (East/west-facing targets go in a downrange strip south of the lane fault, NOT inside the lane.)
3. **No redundant collinear fault segments.** If an inner cutout's edge sits on the same line as an outer-perimeter fault (e.g., both at y=20 for a stretch), drop the inner one. Two faults at the same coordinates clutter the diagram and read as "two shooting areas."
4. **No paper directly in front of a wall.** Pass-through bullets damage club props.
5. **No paper collinear with paper downrange.** Pass-through scores phantom hits.
6. **No-shoots also need bullet-path verification.** A no-shoot in the firing line east of a deep angled paper can be unintentionally hit by a rear-band bullet that's "going to" the paper. Trace the line through the no-shoot's plane for every reachable shooter position before placing.
7. **Every bullet must end in a berm.** Use angled targets to route into side berms when geometry is tight.
8. **Mandatory reload is for short courses only.** Field courses are freestyle.
9. **Round count math**: paper × 2 + steel × 1 = rounds. (Best-2-per-paper, 1-per-steel.)
10. **Fault-line segments must be lengths divisible by 4 ft.** Clubs build fault lines from 4 ft and 8 ft stock sticks. A 5 ft or 7 ft segment can't be assembled cleanly. Plan polygon vertices so every fault segment is 4, 8, 12, 16, 20, 24, 28, or 32 ft long.
11. **Walls with ports must be ADJACENT to the shooter polygon — the shooter walks right up to the port.** Never place a ported wall in the middle of downrange terrain where the shooter has to fire across open space to reach the port; that's a strong shoot-the-wall risk. Walls WITHOUT ports can sit a few feet downrange of the polygon as pure visual blockers, but ported walls always sit on a fault-line edge so the shooter can lean against them.
12. **Wall segments must be lengths buildable from 2, 4, and 8 ft stock panels.** Single panels: 2, 4, or 8 ft. Longer walls: stack panels (8+4=12, 8+8=16, 8+8+4=20, etc.). Valid lengths: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, ... (every even number ≥ 2 that can be decomposed into 2s/4s/8s — which is every even number ≥ 2). Odd-length walls (5, 7, 9, 11, 15, etc.) cannot be built. Plan wall endpoints accordingly.

These are elaborated in `references/safety_rules.md`.

## References (load on demand)

- `references/master_principles.md` — the 5 master-shooter philosophies + the builder's rulebook (verbatim from the source the user supplied)
- `references/safety_rules.md` — USPSA-rules + bullet-path-safety distilled from the dev session
- `references/editor_api.md` — concrete recipes for driving the Stage Setter editor via `mcp__Claude_Preview__preview_eval`
- `references/geometry_rules.md` — v2 coordinate system, target facing math, stand-endpoint formulas
- `references/session_gotchas.md` — specific bugs and design failures from the dev session that produced this skill

## Tone

Default to **terse engineering** with the user — short status updates between chunks, no preamble. Show the screenshot, list what changed, ask what to change next. Save the prose for the final stage brief.
