Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Physgate Build?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/oldsixxiaolv-physgate-build)
---
name: physgate-build
description: "Task 2: Surface physics conditions, human-lock tests (SHA-256) BEFORE coding -> SPEC.md + Solver (add 'c' for confidential)."
disable-model-invocation: true
argument-hint: "[optional: c|confidential] [target solver or DESIGN.md]"
---
# `/physgate-build` — Task 2: Physics Conditions, Human-Locked Tests & Direct Build (Stages 3–4)
**Goal**: Surface physical conditions for **human ruling**, lock **human-written or human line-by-line audited `tests/test_physics.py` via `gate.py lock` BEFORE any solver code**, and implement a clean single-sitting readable solver passing those locked tests.
- **Confidentiality**: Default is Open Research. If `c`/`confidential` or restricted data is involved, `Read` [`../physgate-audit/references/confidential-mode.md`](../physgate-audit/references/confidential-mode.md) before opening workspace files.
- **Inputs & Packs**: Consume `<project_root>/DESIGN.md` if present, and run `python3 ./scripts/gate.py packs` (relative to this skill directory) to fold any matching subfield pack's invariants and analytical limits into Stage 3a.
## 1. Stage 3a: Uncover Physical Conditions & Choose Test Author (`🛑 GATE 3a` — Zero Code Yet)
Propose candidate `PC-01..N` (`Technical + Plain`) across **five general-physics axes** (+ matching Domain Pack):
1. **Units, Bounds & Positivity**: Dimensional homogeneity, $T > 0\ \text{K}$, densities/probabilities $\ge 0$, $|v| < c$, `NaN`/exception on unphysical domains (never fake `0.0`).
2. **Conservation Laws & Symmetries**: Energy, momentum, mass/charge, or $\int |\psi|^2 dV = 1$ with exact coordinate weights ($r\,dr\,d\phi$, $r^2\sin\theta\,dr\,d\theta\,d\phi$), plus parity/Hermiticity/reciprocity.
3. **Simple Special-Case Checks *(Analytical Limits)***: Zero-coupling / uniform-field reductions matching exact closed-form formulas on **both pointwise fields and integrals**.
4. **Grid / Step Convergence & Benchmarks**: Step halving $O(h^p)$ or published reference values.
5. **Nudge-Input Direction Checks *(Physical Monotonicity)***: Required sign (`+`/`-`) when nudging damping, forcing, stiffness, or barrier parameters.
- Invite optional private off-AI holdouts under `.physgate_local/holdout/` (unopened by AI during Stage 4; run by human at Stage 7 `🛑 STOP GATE 5`).
- **Stop at `🛑 GATE 3a`** asking the researcher in **one combined turn** to: **(a)** rule on `PC-01..N`, and **(b)** choose whether they will **(1) write `tests/test_physics.py` themselves** or **(2) audit AI's draft line by line**.
## 2. Stage 3b: Human-Locked `tests/test_physics.py` & Single-Write `SPEC.md` (`🛑 GATE 3b` — Zero Solver Code)
1. **Still zero solver implementation** (at most a 3-line `raise NotImplementedError` import stub). Every test must invoke the live solver in `tmp_path` against analytical/conservation/benchmark truth (never pre-saved solver outputs).
2. Display every `test_pcXX` assertion and `rtol`/`atol` in chat and **stop at `🛑 GATE 3b`** for explicit human approval.
3. Run `python3 ./scripts/gate.py lock tests/test_physics.py` (which enforces `.gitignore` hygiene and writes `.physgate_local/test_physics.sha256`), then write `<project_root>/SPEC.md` **once** with the final SHA-256 digest:
```markdown
# SPEC.md — Frozen Physical Conditions & Test Contract (Task 2)
- **Task**: <title> | **Mode**: <Open | Confidential Sanitized> | **Approved**: <YYYY-MM-DD>
- **Solver Signature & Units**: `<module.py :: fn(inputs [units]) -> outputs [units]>`
- **Locked Test Suite**: `tests/test_physics.py` | **SHA-256**: `<digest from gate.py lock>`
## 1. Governing Equations & Boundary Rules (`A-01..N`)
- `A-01`: <Exact equations, constants, coordinate Jacobians, units, BCs, NaN rules>
## 2. Approved Physical Conditions (`PC-01..N`)
| ID | Axis | Physical Meaning (Tech + Plain) | Exact Criterion & Setup | Tolerance | Test Function |
| :--- | :--- | :--- | :--- | :--- | :--- |
```
## 3. Stage 4: Direct Solver Build, Tamper Verification & Ask-Human Rollback
- **Hard Iron Rule**: AI is strictly forbidden to modify a single byte of `tests/test_physics.py` during Stage 4.
- **Direct Single-Module Build (Zero Unnecessary Ceremony)**: Implement the concise, single-sitting readable solver directly in the workspace without creating disposable `TICKETS.md` or unnecessary multi-branch `git worktree` boilerplate. *(Use isolated `git worktree` branches only when the solver genuinely spans `>= 3` decoupled modules or the researcher explicitly requests branch isolation.)*
- **Ask-Human Rollback**: If equations prove ill-posed or a locked test has a typo/tolerance defect, **present the analytical evidence and ask the researcher** (via clickable choice card or numbered reply—never blocking TTY) whether to roll back (`Task 1` / `Stage 3b`, re-running `gate.py lock` if unlocked) or stay in Stage 4.
- **Mechanical Verification**: Run `python3 ./scripts/gate.py verify` (must exit `0` / `ok`) AND fresh `python -m pytest -v tests/test_physics.py`, then report deliverable paths (`SPEC.md`, `tests/test_physics.py`, `<solver_module>`) ready for `/physgate-audit`.