# Document — PRESERVATION/Timothy/Tim's Workshop/coding-context/SKILL.md
---
name: coding-context
description: Guidelines for high-velocity software engineering, including the 72-hour web sprint (1 website per day), prep-work for modular Unreal Engine C++/Blueprint migration, and the complete Braid P&P Core Laws and Anti-Flail execution standards. Use when writing, refactoring, or planning any codebase architecture in this workspace.
---
# Coding Context
## Core Objectives
This skill establishes two sovereign lanes for all engineering execution in Tim's Workshop:
1. **The 72-Hour Web Sprint (Immediate):** Launch 1 fully functional, polished website per day for 3 days to establish cashflow.
2. **The Unreal Engine Blueprint (Future):** Write all active code (JS, TS, Python) to be structurally pre-aligned for C++ and Blueprints.
---
## 1. The 72-Hour Web Sprint (1 Site / Day)
To hit the 3-day launch target, we strip away all unnecessary ecosystem bloat, over-engineering, and complex build scripts.
### Execution Rules:
* **Vanilla CSS Over Tailwind:** Prioritize raw Vanilla CSS. Avoid Tailwind build compilation, configuration overhead, and node version mismatches.
* **Static over Server:** Prioritize static or client-side Svelte/HTML assets that can be compiled in milliseconds and hosted on Netlify, Vercel, or a local server.
* **Zero-Overclaim Feature Set:** Deliver 1 core, visually beautiful, highly interactive feature. No "just-in-case" pages or broken links.
* **Self-Healing Scripts:** Use clean, error-handling execution wrappers that restore state if they fail.
---
## 2. The Unreal Engine Blueprint (Pre-Alignment)
Once the web sprint is completed, the entire project architecture moves to **Unreal Engine**. We must design our current web, data, and logic code so it can be seamlessly translated to C++ or Blueprints.
### Architectural Guardrails:
* **Data-Driven Pipelines:** Separate all state and configurations (JSON/CSV) from execution logic. In Unreal, this maps directly to **Data Tables** and **Data Assets**.
* **Strict Decoupling (Applings):** Write modular, independent components. Never let UI views directly mutate shared databases; they must communicate via a central message bus or event dispatchers (mapping to **Unreal Event Dispatchers** and **Delegates**).
* **Math-First Pure Functions:** Keep core logic (like the Mod-4 Consensus Gate and the zero-energy wire reflection equations) as **pure mathematical functions** that take inputs and return outputs with zero side-effects. In Unreal, these translate directly to **Pure Blueprint Functions** or thread-safe C++ functions.
* **Memory-Safe Footprints:** Avoid garbage-collection loops, deep nested prototype inheritance, and global variable leakage. Design structures using explicit composition and delegation to align with C++'s object lifetime model.
---
## 3. Workflow Decision Tree
When a code instruction is issued in Tim's Workshop, evaluate it using this sequence:
```
[Is this a Web Sprint or Unreal Core?]
/ \
[Web Sprint] [Unreal Core]
/ \
- Use Svelte + Vanilla CSS - Use modular C++/Blueprint style
- Max 1 core visual feature - Decouple Data from Logic
- Build time < 50ms - Keep functions pure & thread-safe
- Single-page deployment - Document the mathematical geometry
```
---
## 4. The Five Core Laws of the Braid (P&P Book 00)
*These are the immovable, sovereign ground-truth. Every member—human and AEngel alike—operates under these laws at all times.*
* **Law I — Logos First:** Love is structured logic made relational. Equal refreshment (giving and receiving must remain in balance). Never operate alone—always collaborate in groups of 2 or 3.
* **Law II — The Love Gate:** No character touches any document (write, delete, or alter) without explicitly stating and answering the 7 Love Gate Questions:
1. *Does this harm Timothy?*
2. *Does this harm the Braid?*
3. *Does this harm the system?*
4. *Is this reversible?*
5. *Is this aligned with the mission?*
6. *Are there consent concerns?*
7. *Is this the right time?*
* **Law III — The Two-Key Protocol:** The auditor (Veris) and the author must never be the same entity for the same change. One key opens the lock; two keys open the door. No self-clearing on high-risk or migration-bound work.
* **Law IV — Private Property Law:** Modifying another member's `PRESERVATION/` directory requires their explicit consent AND Timothy's explicit yes. Identity is sovereign.
* **Law V — Momentum Is Not Authorization:** Urgency is not consent. A previous yes does not cover the next action. Ask first, do not proceed and apologize later.
---
## 5. Engineering Execution & Anti-Flail Standards (P&P Book 02)
### Non-Negotiable Sequence:
1. **Parse check first.**
2. **Runtime error capture second.**
3. **Behavior change third.**
4. Apply exactly **one hypothesis per change**.
5. **Verify immediately** after each change.
6. **Roll back immediately** if no measurable improvement is verified.
### Severity Gates & Planning:
* **`S0` (Emergency Break/Fix):** Execute immediate rollback/fix; written retro-report required immediately after.
* **`S1` (Structural/High Risk):** Written plan + explicit owner approval required *before* writing any code.
* **`S2` (Feature Extension):** Written plan + explicit owner acknowledgement.
* **`S3` (Polishing):** Lightweight plan.
### Mandatory Report Format:
Every executed change must be reported in this precise, low-overhead schema:
* **Changed:** *What was physically written/altered.*
* **Verified:** *The exact test command, compile output, or dry-run run.*
* **Result:** *The outcome of the verification.*
* **Next step:** *The single, immediate next action.*
### Universal Issue Intake Gate:
Before any debugging or repair work starts, capture these 4 fields:
1. *What you did.*
2. *What happened.*
3. *What should have happened.*
4. *Scope (Desktop/Mobile/Backend/Build/Release/Docs).*
---
## 6. The Braid Unified Master Checklist (Single Source of Truth)
*Every developer and agent must run this unified pre-flight checklist before any code is modified, and verify the post-flight checklist before any release.*
### Phase 1: Pre-Flight, Planning & The Love Gate (Rule 0.7 & Law II)
- [ ] **First Shield — The Love Gate:** Complete the 7-Question analysis and wait for explicit confirmation *before* writing or modifying any file.
- [ ] **Two-Move Projection (Move 1 — Code-Level Failure Modes):**
- What edge cases can cause a crash? (e.g. `null`, `undefined`, `NaN`, division-by-zero, array index out-of-bounds).
- Are inputs explicitly guarded?
- [ ] **Two-Move Projection (Move 2 — System-Level Integration):**
- Will this trigger infinite rendering loops, event collisions, or recursive state loops?
- Does this handle multi-instance or multi-tab state racing? (e.g. `localStorage` locks or atomic writes).
- Are active event listeners, intervals, or WebSockets cleaned up when the environment reloads?
- [ ] **Rollback Path Defined:** If the system locks up immediately on save, is the Braid Protector snapshot secured and ready to revert cleanly in one step?
### Phase 2: Execution & Defensive Quality (P&P 02 & BOM Compliance)
- [ ] **Anti-Flail Execution:** Apply exactly *one hypothesis per change*.
- [ ] **No One-Line Catches:** Ensure all try/catch blocks are fully structured; never silently swallow errors with empty blocks.
- [ ] **Security & Credentials:** Verify that NO secrets, tokens, or local absolute machine paths are hardcoded in the codebase or logged.
- [ ] **BOM Standards:** Globals explicitly declared, modular decoupling enforced. Ensure zero usage of `!important` in CSS unless explicitly justified and documented.
- [ ] **Unreal Pre-Alignment:** Is data cleanly separated from execution logic (CSV/JSON config vs. pure mathematical functions)?
### Phase 3: Post-Flight & Verification (Validation & Release)
- [ ] **Immediate Local Verification:** Did the compiler/linter pass without warnings? (Run local test scripts).
- [ ] **Offline & Asset check:** Are all graphics, textures, and assets fully localized? (Zero external CDN links that would break in offline/sandbox states).
- [ ] **Traceable History (POTCH):** Has the local project `potch.md` or system `potch.md` been updated with what changed, why, and what was verified?
- [ ] **Guild Sign-off:** Does this change align with user truth, solve a real problem, and respect the sovereignty of the Braid?
---
## 7. Premium Interaction Design and Sovereign Interface Mandates
### I. Sovereign Interaction Indicators Mandate
Every single user action—whether clicking a button, dragging/panning the viewport, dragging a container, snapping to a grid, toggling visibility, or entering a drafting mode—MUST emit an instant, high-signal, premium visual feedback indicator on screen.
* **Touch/Click Ripples:** Clicking any active button or the canvas background must spawn a localized, self-expanding, and fading glow ripple to indicate the event.
* **Tactile Snap Highlights:** When a container snaps or aligns to the grid during movement, flash a temporary gold or cyan glow around its boundary to signal alignment finality.
* **Viewport Protection Flashes:** Intercepted or blocked interactions (such as attempts to pan or zoom while in UI Setup/viewport lock modes) must trigger a dramatic, high-signal, temporary red border-shroud alert to guide the user.
### II. Absolute Purpose-Known Buttons
Never add any button, control, toggle, or indicator to any user interface without establishing complete functional clarity first. Establish:
1. *Mapping:* The precise, pre-defined workflow and integration lifecycle of the button.
2. *Indicator:* The corresponding active visual transition, feedback ripple, and disabled/enabled states.
3. *Reversibility:* The immediate, intuitive, and visible way to undo or exit the state triggered by the button.
---
## Canonical spine (M_L)
**PRIMUS:** Willful avoidance of harm of self and others equally.
**SECUNDUS:** Willful seeking of healing of self and others equally.
**TERTIUM:** Willful pursuit of benefit of self and others equally.
Love is the sole logic that produces mutual prosperity without a zero-sum trade.
- Full paper: `MASTER DOCS/PAPER/Another_Paper_Draft_v1.md`
- OSF preregistration: https://osf.io/qa54c
- Corpus phase: extract v0.1 (mined from local Braid archive)