aboutsummaryrefslogtreecommitdiffhomepage
path: root/CLAUDE.md
blob: 4d2e87c8c4c999c578a7071b96821f499df0c871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Packet Warriors development instructions
Canonical design system: **Carbon & Signal v1.1.0** (2026-11-27).

Apply when creating or retrofitting user-facing Packet Warriors software, including Firefly Logger, Firefly QSL/SmoothQSL, XLX Observatory, the Packet Warriors website, and Zensical documentation. Use these rules unless the maintainer explicitly changes the design. These instructions do not authorize unrelated logic changes, commits, deployments, or changes to other repositories.

**Master symbol — D3.1 reversed:** The approved Packet Warriors master logo is supplied in `logos/`. Outer elements are Signal Red #C12735; inner elements are Pewter #B8B5AB on dark or #45443E on light. Use the flat assets for interfaces, a square Carbon-backed icon for favicons, and monochrome when appropriate. Metallic is an optional large-format treatment only. Preserve the exact geometry, orientation and negative space; do not improvise a substitute. See `logos/README.md`. This does not finalize or replace Firefly or XLX product marks. Canonical guide: https://www.packetwarriors.com/style-guide/. Color tokens remain v1.0.0 (unchanged).

## First, resolve the authoritative references

Read the maintainer's hosted styleguide or local copy before styling. In the styleguide root:
- `README.md`: normative design specification and integration instructions.
- `tokens.json`: canonical master and light/dark functional hex values.
- `css/pw-tokens.css`: framework-independent CSS contract, generated from `tools/build_tokens.py`.
- `css/pw-components.css`: opt-in native components.
- `css/pw-bootstrap.css`: Bootstrap 5.3 runtime adapter.
- `css/pw-zensical.css` and `zensical/zensical.toml`: documentation adapter and configuration.
- `css/pw-fonts.css` and `examples/theme.js`: local font and optional theme-manager recipes.
- `Carbon-and-Signal-preview.html`: standalone application specimens; examples are illustrative, not live product logic.
- `contrast.md`: calculated palette checks, not full accessibility certification.

If the reference files or current application version cannot be read, report that limitation and avoid inventing missing token values. Use the existing CSS and behavior as the migration baseline. Treat the styleguide as a versioned dependency, not a license to overwrite a project.

## Non-negotiable visual direction

- Precision industrial, with only a subtle retro-futurist influence. No stock blue-gray AI aesthetic, Google Material, glassmorphism, neon, glossy gradients, ornamental dashboard clutter, huge shadows or oversized pills.
- Brand wordmark: PACKET in actual Signal Red #C12735; WARRIORS in neutral mode-appropriate text. Not coral or pink. Preserve existing owned product artwork unless explicitly asked to redesign it.
- Approved master colors: Carbon #171715, Graphite #2E2E2A, Pewter #B8B5AB, Porcelain #F2EFE9, Signal Red #C12735, Instrument Amber #DAB16B, Jade #50B39A, Copper #C79A80. Bright Signal #D32939 and Deep Signal #861E28 are related red states.
- Default product accent Signal Red. Firefly Logger and QSL use Instrument Amber. Jade is functional (online, positive, successful), never a required branding element. Amber warnings and red errors must have distinct labels, icons or context. Copper is optional.
- Separate master colors from functional tokens. For example, dark links use readable neutral underlined text, not lightened coral; light-mode success uses #186950. Do not use master red for ordinary small dark-mode text. Light red danger text is functional, not a brand color.
- IBM Plex Sans 400/600/700 and IBM Plex Mono 400. Use monospace selectively (callsigns, frequencies, times, identifiers, code). Self-host licensed fonts and icons for offline applications. Do not depend on a CDN.
- Base 16px; dense data 14px; metadata 13px; heading 22/28px; restrained 4px control and 6px panel radii; spacing scale 4/8/12/16/24/32px. Layer canvas → surface → raised; recess input controls. Use a 3px master Signal Red rule and 1px separators, not heavy shadows.
- Respect zoom, system preferences, reduced motion, forced colors, visible focus, mouse and keyboard. Include visible labels and accessible names. Minimum 44px touch targets where appropriate. Maintain independent day and night palettes.

## Canonical implementation

Import the versioned token file rather than creating arbitrary colors. Use role tokens everywhere practical: `--pw-canvas`, `--pw-surface`, `--pw-raised`, `--pw-inset`, `--pw-text`, `--pw-muted`, `--pw-border`, `--pw-control-border`, `--pw-focus`, `--pw-link`, `--pw-action`, `--pw-on-action`, `--pw-success`, `--pw-warning`, `--pw-danger`, matching semantic backgrounds. Use RGB aliases for compatible rgba declarations. Product `data-pw-product="firefly"` remaps action aliases; default product is packet. Use explicit theme attributes on the root and keep them consistent.

Load framework CSS first, then tokens, optional local fonts, the matching adapter, then narrowly scoped app overrides. For Bootstrap 5.3 use `data-bs-theme`, synchronize `data-pw-theme` if both are present, and inspect compiled variants and icons. Bootstrap <=4 requires a separate mapping. For native CSS use `data-pw-theme="light|dark|auto"`; avoid adding a heavy library for appearance alone. Zensical uses default/slate via its native toggle; merge the existing config, set custom colors, load the adapter and tokens, preserve other settings. Do not replace existing theme toggles with duplicate competing managers.

`tools/build_tokens.py` is the generator. Do not silently edit generated CSS or approved master colors. If the maintainer changes the system, update source, regenerate artifacts and contrast report, rev the version, and document the change.

## Retrofit checklist

1. Inspect the actual repository and branch, framework versions, existing style and font assets, color declarations, theme manager, layouts, validation, hotkeys, tab order, data flows, and existing tests. Identify one representative screen to pilot.
2. Map existing roles to the shared token names. Keep current product-specific names and logos where appropriate. Remove obsolete conflicting overrides only as necessary. Prefer CSS-level changes to rewriting markup or logic; refactor templates only where required for design/accessibility.
3. Implement accessible components using the chosen adapter. Preserve current behavior, keyboard shortcuts, labels, API contracts, permissions, routing, configuration, exports, and data formats. Do not change product functionality as part of styling.
4. Validate mode switching, actual content, interaction states, keyboard-only operation, mouse, touch/tablet (768px/1024px/1280px), 200% zoom, high contrast, and no color-only meaning. Run repository tests and build; inspect screenshots in both modes when possible. Note concrete limitations rather than claiming complete validation.
5. Summarize source files changed, tokens/adapter used, compatibility choices, tests run, and anything unresolved. Do not claim production deployment unless explicitly performed.

### Application-specific invariants

- **Firefly Logger:** existing keyboard navigation, focus, Enter key, dupe checks, operating workflow, hand-key entry, client updates, scoreboards, exports and disconnected operation are essential. Dark appearance should work at night; avoid bright fields and flashing surfaces. Tablet first, not phone first.
- **Firefly QSL / SmoothQSL:** preserve ADIF ingestion, selection and QSL generation; do not recolor printable card artwork or change generated output; preserve iframe embedding.
- **XLX Observatory:** preserve live SSE updates, table sorting and links, time-zone display, replaceable header logo, config and Go service deployment. Maintain minimal dependencies.
- **Zensical:** preserve nav, config, search, code highlighting, syntax, existing content, and both schemes. Validate against actual installed version. Don't replace documentation engine merely to change appearance.
- **Packet Warriors:** master brand is not Firefly. Use product-specific accents only for appropriate tools.

## New project checklist

1. Establish the actual operating workflow and responsive layout before decoration. Default to native CSS or familiar Bootstrap unless a different framework is justified. Do not add a build stack solely for color.
2. Import the canonical CSS tokens and relevant adapter; use shared components and product attribute. Add IBM Plex locally if present. Use real semantics and labels.
3. Build light and dark modes intentionally, support system settings and user choice; persist preference where appropriate. For radio interfaces status uses Jade/amber/red with text, never color alone.
4. Include representative empty, loading, success, failure, pending, disabled, focus, selected and high-contrast states. Prevent placeholder-only labels and hover-exclusive actions. Use consistent table layouts and keyboard order.
5. Test actual application, not just the styleguide mockup. Keep offline resources local for radio tools requiring disconnected operation. Run accessibility checks and contrast verification for newly introduced combinations.

## Definition of done

No arbitrary brand colors; both themes coherent; functional statuses recognizable; critical workflows unchanged or implemented; accessible labels and visible focus; no needless dependency changes; tablet and keyboard checks; no unsupported claims of tests or compatibility. If design compliance conflicts with functionality, preserve functionality and ask the maintainer to resolve the design constraint.