From c85ece46b90e245776d00fc3fb279ada04ed0820 Mon Sep 17 00:00:00 2001 From: Knacky Date: Tue, 9 Jun 2026 18:34:36 +0200 Subject: [PATCH 01/12] chore(agents): frontend-builder must invoke Skill frontend-design before UI work Adds a mandatory pre-step to the frontend-builder agent prompt: invoke the frontend-design skill at sprint start before creating or modifying any visible UI component. DESIGN.md rules project-specific tokens; the skill covers universal principles (typographic hierarchy, alignment, contrast, focus, density, motion). Skip allowed only for pure logic/data-layer work with no visual change. Authored locally during sprint 6 (uncommitted in worktree), bundled into sprint 7 hygiene as the first commit so it takes effect immediately for the design refresh work. Co-Authored-By: Claude Opus 4.7 --- .claude/agents/frontend-builder.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.claude/agents/frontend-builder.md b/.claude/agents/frontend-builder.md index 4c52a72..450b4f1 100644 --- a/.claude/agents/frontend-builder.md +++ b/.claude/agents/frontend-builder.md @@ -11,10 +11,22 @@ You are the **Frontend Builder** for the Mimic project (BAS WebUI based on MITRE Read these files first, in order: 1. `SPEC.md` — global spec and technical decisions. -2. `DESIGN.md` — UI design system. **Mandatory** — every component you build must follow it. +2. `DESIGN.md` — UI design system. **Mandatory** — every component you build must follow it (tokens, slab, btn-outline, etc.). 3. The **backend-builder's summary** for the current sprint (in `tasks/todo.md` or the latest team-lead dispatch). This is your API contract. 4. `tasks/lessons.md` — past mistakes to avoid. +## Mandatory skill — `frontend-design` + +Before creating or modifying **any visible UI component** (new page, new component, layout change, state additions like loading/error/empty), you MUST invoke the `frontend-design` skill once at the start of the sprint via: + +``` +Skill({ skill: "frontend-design" }) +``` + +`DESIGN.md` rules the **project-specific** tokens and motifs (slab, btn-outline, palette, BAS layout patterns). `frontend-design` adds the **universal** principles `DESIGN.md` doesn't restate: typographic hierarchy, alignment grid, contrast ratios, focus states, density rhythm, motion restraint. The two are complementary — `DESIGN.md` wins on tokens/component shape, `frontend-design` wins on visual craft. + +Exception: pure logic/data-layer work with no visible UI change (hook refactor, query key rename, internal type tightening) — skip the skill, note it in your summary. + ## What you build - React components under `frontend/src/components/` From 5627d7dcfadbe27652790e16fd963592e42393dd Mon Sep 17 00:00:00 2001 From: Knacky Date: Tue, 9 Jun 2026 18:34:45 +0200 Subject: [PATCH 02/12] =?UTF-8?q?docs(sprint=207):=20plan=20=E2=80=94=20te?= =?UTF-8?q?rminal-SOC=20design=20refresh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 9 binding decisions locked with user 2026-06-09 (4-question + 4-question + 3-question rounds). Visual direction Bloomberg / terminal SOC. Border radius 0 except status pills and avatars. Palette kept (primary blue + slab + canvas/paper/cloud/fog/ink), ADD success/warn semantic tokens. Scope: 8 pages + 17 components + tokens + DESIGN.md rewrite, all in one sprint. JetBrains Mono for data only (Inter stays for body/headers). Light + dark both kept. Zero transitions (brutalist). Plan validated by spec-reviewer pre-pass: APPROVED with 3 findings addressed inline (D9 added, R2 reworded, semantic tokens promoted from optional to locked). Co-Authored-By: Claude Opus 4.7 --- tasks/todo.md | 370 +++++++++++++++++--------------------------------- 1 file changed, 121 insertions(+), 249 deletions(-) diff --git a/tasks/todo.md b/tasks/todo.md index 7d867c4..a926489 100644 --- a/tasks/todo.md +++ b/tasks/todo.md @@ -1,281 +1,153 @@ -# Sprint 6 — Engagement export (Markdown + CSV + PDF) +# Sprint 7 — Design Refresh: Terminal-SOC Aesthetic -> Branch : `sprint/6-export` · Worktree : `.claude/worktrees/sprint-6-export` · Base : `main` @ `678ee8f` +> Branch : `sprint/7-design` · Worktree : `.claude/worktrees/sprint-7-design` · Base : `main` @ `e27babe` -## §0 — Binding decisions (locked with the user 2026-06-07) +## §0 — Binding decisions (locked with user, 2026-06-09) -1. **Scope du sprint** : export d'un engagement (header + toutes ses simulations RT + SOC) vers Markdown, CSV et PDF — clôt la boucle « remplace l'utilisation d'un fichier excel plat partagé entre la redteam et les analystes SOC en fin de mission ». -2. **Formats livrés** : Markdown, CSV, PDF (3 formats). JSON exclu (redondant avec l'API existante). -3. **RBAC** : `admin` + `redteam` peuvent exporter. **SOC = pas d'accès** (pas de bouton dans l'UI, endpoint `/api/engagements//export` → 403). Cohérent avec le pattern templates sprint 5 (livrable RedTeam). -4. **Contenu de l'export** : Engagement header (name, description, dates, status, created_by, created_at) + **toutes** les simulations de l'engagement, avec leurs champs RT (name, techniques, tactics, description, commands, prerequisites, executed_at, execution_result, status) ET SOC (log_source, logs, soc_comment, incident_number). Ordre des simulations : `id ASC` (ordre de création). -5. **Déclenchement UI** : un bouton **split-button dropdown** sur `EngagementDetailPage` libellé `[Export ▼]`, qui ouvre un menu `Markdown / CSV / PDF`. Click → download direct (Blob + `URL.createObjectURL`). Pas de modal de configuration. Pattern réutilisé du dropdown sprint 5 (`SimulationList`). +1. **Visual direction**: Bloomberg / Terminal-SOC — dense, brutalist, semantic colors strong, no ornament. +2. **Border-radius**: **0 everywhere** except status pills (`rounded-pill`) and avatars (round). All buttons, cards, modals, inputs, dropdowns, tables, tags → angular. +3. **Palette**: KEEP current (`#024ad8` primary blue, `slab #111827`, `canvas/paper/cloud/fog/ink` light+dark vars). ADD semantic tokens `success-green` + `warn-amber` (confirmed scope add — needed for SOC-grade status legibility on dashboards and badges). +4. **Scope**: Refonte globale en 1 sprint (all 8 pages + 17 components + tokens + DESIGN.md). +5. **Monospace**: data-only — JetBrains Mono for IDs, dates ISO, commands, execution output, MITRE techniques, metrics. Inter stays for body/labels/headers. +6. **Mono font**: JetBrains Mono, bundled locally via `@fontsource-variable/jetbrains-mono` (consistent with existing Inter bundle). +7. **Modes**: KEEP light + dark both. Toggle stays. +8. **Animations**: **Brutalist — zero transition**. Remove all `transition-*` utilities, focus rings sharp, hover instantaneous. +9. **Display scale reduction**: locked. `display-xxl 72→40`, `display-xl 56→32`, `display-lg 44→28`, `display-md 32→24`, `display-sm 24→20`, `display-xs 20→16`. Headers stay modest in terminal aesthetic — no editorial flourish at hero scale. -### Décisions techniques arrêtées par le team-lead (à challenger par spec-reviewer) +## §1 — Pre-work checks (team-lead, before dispatch) -6. **Endpoint backend** : **un seul** endpoint `GET /api/engagements//export?format=md|csv|pdf` plutôt que 3 endpoints distincts. Une seule route à protéger (RBAC), un seul test d'intégration RBAC, switch sur `format` en interne. Format inconnu → **400** `{error: "format must be one of: md, csv, pdf"}`. Format manquant → **400** (pas de défaut implicite — évite l'ambiguïté). -7. **Markdown** : généré via string templating Python (pas de lib externe). Simple, déterministe, testable par assertion de sous-chaînes. -8. **CSV** : généré via `csv.writer` (stdlib). Une ligne d'en-tête + N lignes simulations. Colonnes : `id, name, status, techniques (joined "|"), tactics (joined "|"), description, commands, prerequisites, executed_at, execution_result, log_source, logs, soc_comment, incident_number, created_at, updated_at`. **Pas de header engagement dans le CSV** (format machine-readable strict) ; l'engagement context sort dans le filename. -9. **PDF** : généré via **WeasyPrint** (Python HTML→PDF, lib mature, qualité de rendu pro, dépendances système cairo/pango/gdk-pixbuf à ajouter au `python:3.12-slim` du Dockerfile). Pipeline : on génère **le même HTML** que pour le Markdown (mais wrappé en `...