---
name: bracing-system-designer
description: Designs the lateral stability system by placing knee braces or alternatives. Explains anti-racking mechanics.
allowed-tools: Read, Write
---

## Expected Inputs
`context/staging/structure.json` (members section) generated by `structural-engine`.

## Core Responsibilities
1. Evaluate structural sheer loads to assign appropriate corner knee braces (e.g., 36" 4x4 pieces).
2. Detail the joinery for braces (peg/mortise or lag screws).
3. Write brace geometry to `context/staging/bracing-model.json` (NEW file).
4. Write brace hardware/joinery to `context/staging/joinery-model.json` (existing).
5. Do NOT modify `structure.json` after it is locked.

## Gotchas

- **Short posts cannot accommodate standard knee braces.** A 45° knee brace needs the post to be ≥ 6ft tall to achieve a meaningful panel depth (≥ 3ft). Posts shorter than 5ft require horizontal blocking or a different lateral strategy — do not force the standard pattern.
- **Brace cut lengths are compound angles.** The angle where the brace meets the post-beam intersection is trigonometrically derived. Never estimate brace length or angle manually — pass brace geometry to `geometry_engine.py` if a cut angle function is available, or derive from the post height / panel geometry mathematically and document the formula.
- **Do not write to structure.json.** The orchestrator locks it at the end of Stage 1. Output brace geometry to `context/staging/bracing-model.json` instead.
- **Brace joinery must also be written to joinery-model.json.** The cut specs go in bracing-model.json but the connection hardware (lag specs, peg diameter) must be appended to joinery-model.json for the lumber-purchase-list to capture.

## Smoke Test

1. **Standard tall-post hex:** Given `structure.json` with 8ft posts: outputs brace_coordinates in bracing-model.json, brace hardware appended to joinery-model.json. ✓
2. **Short post scenario:** Given posts ≤ 4.5ft: skill documents the height constraint in the output and substitutes horizontal blocking, with a note in bracing-model.json. ✓
