|
2 | 2 | applyTo: "**" |
3 | 3 | --- |
4 | 4 |
|
5 | | -# OUDS Web — AI Agent Instructions |
| 5 | +# OUDS Web — Project Context |
6 | 6 |
|
7 | | -You are working in **OUDS Web** (Orange Unified Design System — Web), a multi-brand design system built as a fork of Bootstrap 5.3.6. |
8 | | -Version: 1.1.0 | Main branch: `ouds/main` | Brands: Orange, Sosh, Orange Compact |
| 7 | +**OUDS Web** (Orange Unified Design System — Web) is a multi-brand design system built as a fork of Bootstrap 5.3.6. It serves 3 brands (Orange, Sosh, Orange Compact) from a single codebase where only CSS tokens differ per brand — JavaScript is fully shared. |
9 | 8 |
|
10 | | ---- |
11 | | - |
12 | | -## Standards — Apply Always |
13 | | - |
14 | | -The following standards define mandatory conventions. Always apply them when writing or reviewing code: |
15 | | - |
16 | | -- **[Code Conventions](.packmind/standards/ouds-code-conventions.md)** — HTML/SCSS/JS style rules: `!default` on variables, forbidden direct properties (`border-radius`, `transition`), forbidden values (`border: none`, `lighten()`), token usage, JS no-semicolons, template literals. |
17 | | - |
18 | | -- **[Accessibility WCAG 2.2 AAA (with AA fallback)](.packmind/standards/ouds-accessibility-wcag.md)** — Target WCAG 2.2 Level AAA with documented fallback to AA for specific color and UI constraints. Non-negotiable: `@include focus-visible()`, ARIA attributes, `.visually-hidden`, keyboard navigation, 7:1 text contrast (AAA) / 4.5:1 fallback (AA), 44×44px touch targets, RTL support, cognitive accessibility. |
19 | | - |
20 | | -- **[Design Token System](.packmind/standards/ouds-design-tokens.md)** — 3-tier hierarchy (raw → semantic → component). Never edit auto-generated files (`_raw.scss`, `_semantic.scss`, `_component.scss`, `_*-custom-props.scss`). Colors via `var(--#{$prefix}color-*)`. New tokens in all 3 brands. |
21 | | - |
22 | | -- **[Component Patterns](.packmind/standards/ouds-component-patterns.md)** — CSS custom property declaration at top of class, state overrides via variable overrides, `scss-docs-start/end` markers, `// OUDS mod:` comments, JS BaseComponent pattern. |
23 | | - |
24 | | ---- |
25 | | - |
26 | | -## Commands — Use for Specific Workflows |
27 | | - |
28 | | -When the user asks to perform a specific task, load and follow the appropriate command: |
29 | | - |
30 | | -- **[ouds-create-component](.packmind/commands/ouds-create-component.md)** — Full step-by-step guide for creating a new SCSS/JS component (SCSS structure, tokens per brand, ARIA, JS boilerplate, tests, docs). |
| 9 | +## Quick Reference |
31 | 10 |
|
32 | | -- **[ouds-diagnose-error](.packmind/commands/ouds-diagnose-error.md)** — Diagnostic workflow for Stylelint, ESLint, Sass build, CI, token, JS test, and Pa11y errors. |
33 | | - |
34 | | -- **[ouds-decision-routing](.packmind/commands/ouds-decision-routing.md)** — 4 decision trees (where to put code, which token, multi-brand updates, testing strategy). |
35 | | - |
36 | | -- **[ouds-lookup](.packmind/commands/ouds-lookup.md)** — Quick lookup index: maps any topic to the right standard, command, or skill. |
37 | | - |
38 | | -- **[ouds-validate-tokens](.packmind/commands/ouds-validate-tokens.md)** — Read-only audit: cross-brand token presence check and anti-pattern detection for SCSS component files. |
| 11 | +| Key | Value | |
| 12 | +|---|---| |
| 13 | +| Version | 1.1.0 | |
| 14 | +| Main branch | `ouds/main` | |
| 15 | +| CSS prefix | `--bs-` (via `$prefix`) | |
| 16 | +| Build | `npm run dist` | |
| 17 | +| Lint | `npm run lint` | |
| 18 | +| Tests | `npm run test` | |
| 19 | +| Dev servers | `:9001` (orange) · `:9002` (sosh) · `:9003` (orange-compact) | |
39 | 20 |
|
40 | | ---- |
| 21 | +## Critical Constraints |
41 | 22 |
|
42 | | -## Skills — Domain Knowledge |
| 23 | +These rules are non-negotiable and apply to every contribution: |
43 | 24 |
|
44 | | -Load these skills when deep conceptual understanding is needed: |
| 25 | +1. **Use tokens, not hardcoded values** — colors, spacing, dimensions all come from the OUDS token system. |
| 26 | +2. **Use mixins for `border-radius` and `transition`** — direct CSS properties are forbidden by Stylelint. |
| 27 | +3. **Auto-generated token files are read-only** — never edit `_raw.scss`, `_semantic.scss`, `_component.scss`, or `_*-custom-props.scss`. Only `_composite.scss` is hand-editable. |
| 28 | +4. **Never commit `dist/`** — build artifacts are generated in CI. |
| 29 | +5. **JavaScript lives in `js/src/` only** — never in `packages/<brand>/`. |
| 30 | +6. **Colors use CSS custom properties** — `var(--#{$prefix}color-*)` enables runtime dark mode switching. |
| 31 | +7. **Accessibility is mandatory** — visible `:focus-visible`, ARIA attributes on all interactive elements, `.visually-hidden` for SR content. |
45 | 32 |
|
46 | | -- **[ouds-token-strategy](.packmind/skills/ouds-token-strategy.md)** — Full token architecture: pipeline, layer hierarchy, CSS custom property bridge for dark mode, color token dual-track, consumption patterns. Load when asked about tokens, dark mode, or brand differentiation. |
| 33 | +## Scoped Instructions |
47 | 34 |
|
48 | | -- **[ouds-multi-brand-sync](.packmind/skills/ouds-multi-brand-sync.md)** — 3-brand architecture: what is shared, what differs, when to update all brands, brand entry point pattern, testing multi-brand changes. |
| 35 | +Detailed conventions are loaded automatically based on the files you're working on. They live in `.github/instructions/`: |
49 | 36 |
|
50 | | -- **[ouds-knowledge-base](.packmind/skills/ouds-knowledge-base.md)** — Full glossary (154 terms), build pipeline, npm scripts reference, CI/CD jobs, release process, and project file map. Load when encountering unfamiliar terms or working on build/infra. |
| 37 | +- `scss.instructions.md` — SCSS conventions and patterns |
| 38 | +- `javascript.instructions.md` — JS conventions |
| 39 | +- `html-accessibility.instructions.md` — HTML structure and WCAG compliance |
| 40 | +- `tokens.instructions.md` — Token system rules |
| 41 | +- `components.instructions.md` — Component SCSS/JS patterns |
| 42 | +- `multi-brand.instructions.md` — Cross-brand synchronization |
51 | 43 |
|
52 | | ---- |
| 44 | +## Workflows |
53 | 45 |
|
54 | | -## Critical Constraints (Always Active) |
| 46 | +For complex multi-step tasks, follow the dedicated workflow guides: |
55 | 47 |
|
56 | | -1. **Never hardcode** colors (`#ff7900`), spacing (`16px`), or dimensions — use OUDS tokens. |
57 | | -2. **Never use `border-radius: X` or `transition: X` directly** — use `@include border-radius()` / `@include transition()`. |
58 | | -3. **Never edit auto-generated token files**: `_raw.scss`, `_semantic.scss`, `_component.scss`, `_*-custom-props.scss` — only `_composite.scss` is editable. |
59 | | -4. **Never commit `dist/`** files — they are build artifacts. |
60 | | -5. **Never put JavaScript** in `packages/<brand>/` — JS is shared via `js/src/`. |
61 | | -6. **Color tokens for dark mode** → always `var(--#{$prefix}color-*)`, never the SCSS variable directly. |
62 | | -7. **Accessibility**: never remove `:focus-visible` styles, always add ARIA attributes to interactive components, never use `display: none` for screen-reader content. |
| 48 | +- `workflows/create-component.instructions.md` — Creating a new component |
| 49 | +- `workflows/diagnose-errors.instructions.md` — Debugging build/lint/CI errors |
| 50 | +- `workflows/validate-tokens.instructions.md` — Auditing token usage |
63 | 51 |
|
64 | | ---- |
| 52 | +## Deep References |
65 | 53 |
|
66 | | -## Project Quick Facts |
| 54 | +For in-depth architecture knowledge, read the reference docs in `.github/instructions/references/`: |
67 | 55 |
|
68 | | -| | | |
69 | | -|---|---| |
70 | | -| CSS prefix | `--bs-` (via `$prefix` in `scss/_config.scss`) | |
71 | | -| Brands | orange, sosh, orange-compact | |
72 | | -| JS components | 15 (all extend `BaseComponent`) | |
73 | | -| Token layers | raw → semantic → composite → component → CSS custom props | |
74 | | -| Build | `npm run dist` (CSS + JS) | |
75 | | -| Lint | `npm run lint` | |
76 | | -| Tests | `npm run test` | |
77 | | -| Dev servers | `:9001` (orange), `:9002` (sosh), `:9003` (orange-compact) | |
| 56 | +- `token-architecture.md` — Full token pipeline and layer hierarchy |
| 57 | +- `glossary.md` — 154 project-specific terms |
| 58 | +- `project-map.md` — File structure, npm scripts, CI/CD jobs |
0 commit comments