# Technical Blog Project Standards & Architectural Specification This document defines the authoritative engineering, design, templating, and security standards for this technical publication codebase. All new implementations, pull requests, refactors, and debugging tasks must conform to these rules. --- ## 1. User Content Sovereignty (Highest Priority) 1. **User Edits Are Absolute Ground Truth:** - The user's custom writing, post titles, tags, navigation labels, terminology, and naming choices strictly supersede any boilerplate, skill instructions, or sample mockups (`sample-designs/*`). 2. **No Unsolicited Modifications:** - Never overwrite, sanitize away, or rename user-authored text without explicit instruction. 3. **Mandatory Clarification Gate:** - Inconsistencies or typos in user writing must be flagged for clarification rather than unilaterally changed. --- ## 2. Strict Test-Driven Development (TDD) & Adversarial Verification 1. **Test-First Invariant (Tests Before Code):** - Automated test cases in `test/*.test.js` MUST ALWAYS be written and established *before writing or modifying any functional code* (filters, templates, server routes, ingestion logic, build scripts). - Never implement or modify production code prior to establishing tests. 2. **Mandatory Adversarial Testing:** - Every functional implementation must include adversarial tests designed to actively falsify assumptions: - Missing or malformed configuration (e.g., unset `SITE_DOMAIN` must throw). - Corrupt or unexpected inputs (empty strings, `null`, `undefined`, unexpected types, HTML injections, path traversals, giant payloads). - Boundary values and edge cases. - Design rule violation assertions (0 instances of forbidden CSS patterns). - Link and anchor integrity checks. 3. **Pre-Presentation Verification Gate:** - Before presenting the final output to the user, run `npm test`. - All test cases must pass before presenting the final output. Delivering unverified or failing code is strictly forbidden. --- ## 3. Design System & CSS Specification Strict adherence to `sample-designs/design-specification.md` is mandatory. ### 3.1 Color Palette & Token Variables All colors must use standard CSS custom properties defined in `src/assets/css/tokens.css`: - Canvas: `var(--bg-canvas)` (`#0d0f12`) - Surface: `var(--bg-surface)` (`#121417`) - Elevated: `var(--bg-elevated)` (`#1c1f26`) - Borders: `var(--border-color)` (`#2b303b`) - Text: `var(--text-primary)` (`#e0e6f0`), `var(--text-muted)` (`#8a95a5`) - Accents: `var(--accent-cyan)` (`#00f0ff`), `var(--accent-green)` (`#00e676`), `var(--accent-amber)` (`#ffb700`), `var(--accent-red)` (`#ff5252`) ### 3.2 Hard Anti-Patterns (Forbidden) - **NO Glassmorphism:** Never use `backdrop-filter: blur(...)`. - **NO Drop Shadows or Glows:** `box-shadow: none;` and `text-shadow: none;` only. - **NO Gradients:** Never use `linear-gradient`, `radial-gradient`, or `conic-gradient`. Flat solid surfaces only. - **NO Rounded Bubbles:** `border-radius` is strictly capped between `0px` and `4px` maximum. - **NO Floaty / Delayed Transitions:** Hover and state transitions must be instant binary snaps (`transition: none;` or `transition: 0s;`). ### 3.3 Typography & Modularity - UI & Code: `IBM Plex Mono`, `JetBrains Mono`. - Body Prose: `Inter`. - CSS Modularity: Zero monolithic inline `