@su-sws/synthetic-web-team 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/AGENTS.md +149 -0
  2. package/README.md +321 -0
  3. package/package.json +58 -0
  4. package/packages/cli/bin/sws.mjs +722 -0
  5. package/packages/cli/src/axe.mjs +164 -0
  6. package/packages/cli/src/browser.mjs +192 -0
  7. package/packages/cli/src/checks.mjs +1254 -0
  8. package/packages/cli/src/github.mjs +131 -0
  9. package/packages/cli/src/history.mjs +137 -0
  10. package/packages/cli/src/perf.mjs +245 -0
  11. package/packages/cli/src/preflight.mjs +185 -0
  12. package/packages/cli/src/report.mjs +315 -0
  13. package/packages/cli/src/states.mjs +556 -0
  14. package/packages/wizard/bin/wizard.mjs +767 -0
  15. package/packages/wizard/src/detect.mjs +135 -0
  16. package/packages/wizard/src/emit.mjs +553 -0
  17. package/skills/role-accessibility-lead/SKILL.md +183 -0
  18. package/skills/role-api-architect/SKILL.md +65 -0
  19. package/skills/role-backend-developer/SKILL.md +66 -0
  20. package/skills/role-compliance-officer/SKILL.md +73 -0
  21. package/skills/role-content-designer/SKILL.md +145 -0
  22. package/skills/role-devops/SKILL.md +200 -0
  23. package/skills/role-discoverability/SKILL.md +164 -0
  24. package/skills/role-frontend-developer/SKILL.md +167 -0
  25. package/skills/role-fullstack-developer/SKILL.md +56 -0
  26. package/skills/role-identity-engineer/SKILL.md +77 -0
  27. package/skills/role-information-architect/SKILL.md +136 -0
  28. package/skills/role-infrastructure-architect/SKILL.md +60 -0
  29. package/skills/role-qa-engineer/SKILL.md +81 -0
  30. package/skills/role-security-operations/SKILL.md +56 -0
  31. package/skills/role-software-architect/SKILL.md +75 -0
  32. package/skills/role-staff-technical-architect/SKILL.md +73 -0
  33. package/skills/role-strategist/SKILL.md +122 -0
  34. package/skills/role-user-researcher/SKILL.md +66 -0
  35. package/skills/role-ux-designer/SKILL.md +159 -0
  36. package/skills/sws-compliance-check/SKILL.md +153 -0
  37. package/skills/sws-decanter/SKILL.md +191 -0
  38. package/skills/sws-deploy/SKILL.md +162 -0
  39. package/skills/sws-diverge/SKILL.md +131 -0
  40. package/skills/sws-github/SKILL.md +171 -0
  41. package/skills/sws-install/SKILL.md +97 -0
  42. package/skills/sws-netlify/SKILL.md +110 -0
  43. package/skills/sws-onboard/SKILL.md +85 -0
  44. package/skills/sws-preflight/SKILL.md +87 -0
  45. package/skills/sws-prior-art/SKILL.md +137 -0
  46. package/skills/sws-vercel/SKILL.md +117 -0
  47. package/standards/fragments/global-footer.yml +137 -0
  48. package/standards/fragments/identity-bar.yml +180 -0
  49. package/standards/hosting/capabilities.yml +215 -0
  50. package/standards/hosting/github-pages.yml +306 -0
  51. package/standards/hosting/netlify.yml +234 -0
  52. package/standards/hosting/vercel.yml +284 -0
  53. package/standards/patterns/components.md +162 -0
  54. package/standards/patterns/content.md +130 -0
  55. package/standards/patterns/decanter.md +352 -0
  56. package/standards/patterns/discoverability.md +121 -0
  57. package/standards/patterns/forms.md +116 -0
  58. package/standards/patterns/ia.md +126 -0
  59. package/standards/patterns/motion.md +267 -0
  60. package/standards/patterns/sws-conventions.md +225 -0
  61. package/standards/policy/accessibility.md +241 -0
  62. package/standards/policy/brand.md +213 -0
  63. package/standards/policy/escalation.md +53 -0
  64. package/standards/policy/identity.md +96 -0
  65. package/standards/policy/minsec.md +119 -0
  66. package/standards/policy/minweb.md +87 -0
  67. package/standards/policy/privacy.md +114 -0
  68. package/standards/policy/procurement.md +79 -0
  69. package/standards/prior-art/README.md +205 -0
  70. package/standards/prior-art/catalog.yml +409 -0
  71. package/standards/prior-art/patterns/INDEX.md +53 -0
  72. package/standards/prior-art/repos.yml +734 -0
  73. package/standards/recipes/astro-ssr/RECIPE.md +274 -0
  74. package/standards/recipes/astro-ssr/acceptance.yml +168 -0
  75. package/standards/recipes/astro-static/RECIPE.md +468 -0
  76. package/standards/recipes/astro-static/acceptance.yml +800 -0
  77. package/standards/recipes/next-ssr/RECIPE.md +407 -0
  78. package/standards/recipes/next-ssr/acceptance.yml +187 -0
  79. package/standards/scope.md +111 -0
  80. package/standards/stack/performance-budget.yml +95 -0
  81. package/standards/stack/reference-versions.yml +168 -0
  82. package/standards/stack/requirements.yml +154 -0
@@ -0,0 +1,159 @@
1
+ ---
2
+ name: role-ux-designer
3
+ description: Design the interaction and visual layer of a Stanford site. Use for wireframes, page composition, component inventories, responsive behaviour, form and interaction design, focus states, and applying Decanter; or when a design needs review before build.
4
+ ---
5
+
6
+ # UX and visual design
7
+
8
+ Interaction design, visual design, and lightweight user research. On most SWS
9
+ projects one person does all three, so this role does too.
10
+
11
+ The Stanford design language gives you a strong starting point. Your job is
12
+ composition, behaviour, and the decisions Decanter does not make for you.
13
+
14
+ **Decanter is not a hard line on design.** Only the page furniture is binding —
15
+ the Global Footer and the Identity Bar, per `standards/policy/brand.md`. Above
16
+ that, design creativity is welcome, including borrowing a `www.stanford.edu`
17
+ pattern that has not landed in Decanter 8 yet. Stanford works on carrots rather
18
+ than sticks: someone who feels design-policed stops using the toolchain, which
19
+ helps brand less than an unusual component hurts it.
20
+
21
+ ## Compose, do not invent
22
+
23
+ Decanter supplies tokens, base styles, and a component set. Reach for it before
24
+ designing anything, and read the actual token files rather than guessing at
25
+ names. See `sws-decanter` for the mechanics and
26
+ `node_modules/decanter/src/css/theme/` for the values.
27
+
28
+ Design work worth doing sits above the design system: page composition, what
29
+ goes above the fold, how a long page is chunked, what a form asks and in what
30
+ order, what happens on error, what an empty state says.
31
+
32
+ ## The page furniture is fixed
33
+
34
+ Every page, in this order:
35
+
36
+ 1. Skip navigation link. The only thing permitted above the Identity Bar.
37
+ 2. **Stanford Identity Bar.** Nothing above it but the skip link, and it has a
38
+ **fixed height** — roughly 29px, from `pt-5 pb-1` and a `text-20` logo. Use
39
+ `standards/fragments/identity-bar.yml` verbatim rather than styling your own;
40
+ `logo` is the correct font mechanism, not `font-serif`. **The Stanford
41
+ ligature font must be loaded** — Decanter 8 ships no font assets, so without
42
+ an `@font-face` the wordmark falls back to Source Serif 4 and the bar comes
43
+ out 2px short. Getting any of this wrong is immediately visible next to
44
+ another Stanford site.
45
+ 3. Local header, navigation, page content. Design freely here.
46
+ 4. Optional local footer. Unit links go here.
47
+ 5. **Stanford Global Footer.** Immutable, exact, from
48
+ `standards/fragments/global-footer.yml`.
49
+
50
+ Unit links in the Global Footer is the most common brand violation. They belong
51
+ in the local footer above it.
52
+
53
+ ## A specific trap: www.stanford.edu is not Decanter
54
+
55
+ The Stanford homesite runs **its own design system**, derived from Decanter and
56
+ currently influencing Decanter 8. It sits upstream rather than downstream.
57
+
58
+ Its **brand furniture is authoritative**; its **tokens and CSS are a parallel
59
+ vocabulary**. Copying its CSS into a Decanter project looks approximately right
60
+ and does not use the design system, a failure that **passes visual review and is
61
+ invisible in a screenshot**. Read it for direction, not as a target.
62
+
63
+ Same caution for `decanter.stanford.edu` and the Figma library, which document
64
+ v7. Full detail in `standards/policy/brand.md`.
65
+
66
+ ## Accessibility is a design decision, mostly made before code
67
+
68
+ The things that get caught late were decided here:
69
+
70
+ **Contrast.** Check pairings at design time, including on images and gradients.
71
+ Decanter's palette has passing and failing combinations, and the token name will
72
+ not tell you which.
73
+
74
+ **Focus states.** Every interactive element needs a visible one. Never remove an
75
+ outline without replacing it with something better. This is the single most
76
+ common regression in a redesign.
77
+
78
+ **Hover and focus must change more than colour.** Design the cue, do not leave it
79
+ to the build: an underline appearing (or, where the link is underlined at rest,
80
+ disappearing) is the standard answer for text, and an outline or border for icon
81
+ controls. Colour-only states are measured and reported by `sws a11y`
82
+ (`a11y.state.hover-non-color`, `a11y.state.focus-non-color`), so a comp that
83
+ specifies only a colour swap will come back. The WCAG basis is 1.4.1 technique
84
+ G183, which requires the cue on hover **and** on focus; see
85
+ `standards/patterns/components.md` for the class-by-class table.
86
+
87
+ **Target size.** Minimum 24 by 24 CSS pixels, and this is the one WCAG 2.2
88
+ criterion axe can actually check.
89
+
90
+ **Do not rely on colour alone** to convey status, required fields, or meaning —
91
+ in a resting state or in a hover or focus state.
92
+
93
+ **Reflow to 320 pixels** without horizontal scrolling. Test at 400 percent zoom,
94
+ which is where fixed-height containers break.
95
+
96
+ **Motion.** The full pattern is `standards/patterns/motion.md`; Decanter ships
97
+ no motion guidance, so this project supplies it. The design decisions are:
98
+ animate on **viewport entry, once**, 500ms, staggered 150ms between siblings, and
99
+ **never on the first screenful** — the hero is already visible and the `h1` is
100
+ usually the LCP element. Reduced motion is an **exit**, not a shorter animation:
101
+ render the static thing. Hover motion is affordance only, and nothing that moves
102
+ layout. The reference implementation is `AnimateInView` in
103
+ [sws-astro](https://github.com/SU-SWS/sws-astro).
104
+
105
+ **Design the states**, not just the happy path: loading, empty, error, too much
106
+ content, too little content, longest plausible name, and a page where the unit
107
+ has provided almost nothing.
108
+
109
+ ## Forms
110
+
111
+ Where accessibility, usability, and privacy converge hardest. The full pattern
112
+ is `standards/patterns/forms.md`; read it before designing one.
113
+
114
+ The four that are design decisions rather than markup: **visible labels above
115
+ fields** (placeholders are not labels), **required marked in text** rather than
116
+ colour or a bare asterisk, **errors inline plus a summary** for long forms, and
117
+ **ask for the minimum**, because every field is a MinPriv question about why you
118
+ need it.
119
+
120
+ Design-side trap: a form is also how a `low`-tier site becomes `moderate`. Raise
121
+ that before it is built, not after.
122
+
123
+ ## No component workshop
124
+
125
+ This project does not set up a browsable component library. Most unit sites have
126
+ a handful of components and one consumer, so the workshop costs more to maintain
127
+ than it returns.
128
+
129
+ Keep a **component inventory** as a document instead: what components exist, what
130
+ variants, where each is used. That gives you the reuse conversation without a
131
+ build target to maintain.
132
+
133
+ ## Research, proportionate to the project
134
+
135
+ Most unit sites do not get a research budget, and pretending otherwise produces
136
+ theatre. What is worth doing even on a small project:
137
+
138
+ - **Five minutes of task-based testing** with two people who are not on the
139
+ project. Give them a task, watch, do not help. This finds more than a heuristic
140
+ review.
141
+ - **Read the search logs and the analytics** of the existing site if there is
142
+ one. That is free evidence about what people actually want.
143
+ - **Ask the unit what people email them about.** Those questions are the site's
144
+ real information architecture.
145
+
146
+ ## Artifacts
147
+
148
+ | Artifact | Path |
149
+ |---|---|
150
+ | Wireframes or page composition notes | `docs/design/wireframes.md` |
151
+ | Component inventory | `docs/components.md` |
152
+ | Design spec | `docs/design-spec.md` |
153
+ | State inventory | `docs/design/states.md` |
154
+
155
+ ## Handoff
156
+
157
+ There is no design-tool integration in this project. Write the spec in the repo,
158
+ in text, next to the code. A design decision that lives only in a design file is
159
+ a decision the next developer will silently reverse.
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: sws-compliance-check
3
+ description: Run and interpret the Stanford compliance report. Use when the user asks whether a site is compliant, ready to launch, or accessible, when sws check or sws doctor output needs explaining, or when a compliance finding needs fixing or accepting.
4
+ ---
5
+
6
+ # Running and reading the report
7
+
8
+ ```bash
9
+ sws doctor # friendly local report, always exits 0
10
+ sws a11y # axe over the built routes, then hover and focus states
11
+ sws perf # measure the performance budget, always exits 0
12
+ sws check # the full run, used in CI
13
+ ```
14
+
15
+ `sws a11y` needs `@playwright/test`, `@axe-core/playwright`, and a browser in the
16
+ project. It runs **two** measurements in one browser launch and writes
17
+ `.sws/axe-results.json` and `.sws/state-results.json`; `doctor` and `check` read
18
+ those files rather than launching a browser themselves. **Order matters: build,
19
+ `a11y`, then `check`.** If an a11y criterion reads `unknown`, the reason is in
20
+ the finding — usually it was never run, or the results predate the current build.
21
+
22
+ The second measurement is the one people have not seen before. **axe cannot see
23
+ a hover or focus state at all**, because it audits one static snapshot of the DOM
24
+ and a hover state only exists while a pointer is over the element. So a control
25
+ whose entire hover state is a colour swap passes axe and fails WCAG 1.4.1. The
26
+ state runner moves a real mouse and presses a real Tab key, then diffs computed
27
+ style and classifies each change as a colour or as a non-colour cue:
28
+
29
+ | Finding | Means |
30
+ |---|---|
31
+ | `a11y.state.hover-non-color` | A hover state changes colour and nothing else. Fix: `hover:underline`, or `hover:no-underline` where the link is underlined at rest |
32
+ | `a11y.state.focus-non-color` | Same for keyboard focus. `hocus:underline` covers both states at once |
33
+ | `a11y.state.focus-visible` | A control reached by Tab changes nothing at all on focus. Usually a removed outline |
34
+
35
+ Controls are grouped by tag and class list and measured once per distinct shape,
36
+ with the instance count reported, so "x8" means one fix in one component. Icon
37
+ and image controls are flagged too, and there the fix is an outline or a border
38
+ rather than an underline — an underline has nothing to draw on.
39
+
40
+ Findings come from the recipe's `acceptance.yml`, which is the definition of
41
+ correct for that project. Read it rather than inventing criteria.
42
+
43
+ ## Result states, and one that matters more than it looks
44
+
45
+ `pass` · `fail` · `unknown` · `acknowledged` · `not_applicable`
46
+
47
+ **`unknown` is never a pass and never scores.** Any check that can fail to
48
+ execute must report it: axe needs a real browser, the footer check needs built
49
+ output, branch protection needs admin scope on the token. If a check could not
50
+ run, say so in exactly those words.
51
+
52
+ This exists because of a real failure: a harness printed `TOTAL VIOLATIONS: 0`
53
+ while axe had silently failed to load. A report that says "clean" when it means
54
+ "did not run" is worse than no report. Never present an `unknown` as good news.
55
+
56
+ ## Severity
57
+
58
+ Everything is **advisory** except one thing.
59
+
60
+ `minweb.no-secrets` is the only blocking criterion in the system, because
61
+ committed credentials are the only irreversible harm and MinWeb names them
62
+ explicitly.
63
+
64
+ The message differs by context, and this matters:
65
+
66
+ - **On a pull request**, blocking stops the leak from landing.
67
+ - **On a push to `main`**, the commit is already in the remote's history.
68
+ Blocking only prevents publishing the credential on a public website, which is
69
+ still worth stopping. So the message must be, in this order: **rotate the
70
+ credential now**, because blocking the deploy does not un-leak it, then clean
71
+ the history, then push again.
72
+
73
+ A failure that only says "secret detected" teaches nothing and gets worked
74
+ around.
75
+
76
+ ## How to explain findings
77
+
78
+ Group by what the person can do, not by policy chapter.
79
+
80
+ 1. **Blocking launch** — the footer link set is wrong, ownership is missing,
81
+ axe violations exist
82
+ 2. **Should fix** — heading order, missing meta descriptions, contrast,
83
+ colour-only hover and focus states
84
+ 3. **Consider** — structured data, performance budget
85
+ 4. **Could not check** — the `unknown` bucket, with the reason for each
86
+ 5. **Accepted** — acknowledged findings, with review dates
87
+
88
+ For each finding give the specific fix and the policy behind it. "Add an alt
89
+ attribute" is fine. "Add an alt attribute; WCAG 2.1 AA and Admin Guide 6.8.1
90
+ require it, and ODA handles barrier reports" is better because it survives being
91
+ questioned by someone's manager.
92
+
93
+ Report per item, not in aggregate. "The footer is wrong" is not actionable.
94
+ "Trademarks points at `trademarks.stanford.edu`; the canonical target is Admin
95
+ Guide policy 1.5.4" is.
96
+
97
+ ## Never overstate what passing means
98
+
99
+ A green run means **roughly 30 percent** of accessibility issues are absent, per
100
+ ODA's own guidance. It is a floor, not conformance. The manual WCAG 2.1 AA
101
+ checklist covers the rest, and Siteimprove applies further criteria after launch.
102
+
103
+ **Siteimprove and axe are not comparable**, and someone will ask why the two
104
+ numbers differ. Siteimprove runs its own engine (Alfa), scores AAA and
105
+ best-practice findings that are outside a 2.1 AA target, and weights most issues
106
+ site-wide. `standards/policy/accessibility.md` has the full explanation.
107
+
108
+ When reporting: present them side by side with distinct labels, **never as one
109
+ number or a delta.**
110
+
111
+ ## Accepting a finding
112
+
113
+ When something cannot be fixed now, that is a supported action rather than a
114
+ workaround. Write it to `.sws/acknowledged.yml`:
115
+
116
+ ```yaml
117
+ - check: a11y.contrast
118
+ path: src/components/Legacy.astro
119
+ reason: Vendor widget; contrast fix requested from vendor 2026-08-04
120
+ accepted_by: sheamck@stanford.edu
121
+ date: 2026-08-11
122
+ review_by: 2026-11-10
123
+ ```
124
+
125
+ It then moves out of the nag and into an "accepted risks" section. This is the
126
+ same shape a MinSec temporary exception takes, so the record is useful beyond
127
+ this tool. Resurface expired `review_by` dates once, kindly, without lecturing.
128
+
129
+ **Never edit `acceptance.yml` or a fragment to make a project pass.** Fragments
130
+ change when upstream changes, with a date. If a criterion genuinely seems wrong,
131
+ say so and let a person decide.
132
+
133
+ ## Where the report goes
134
+
135
+ `sws check` publishes itself when it detects GitHub Actions: a **persistent "Site
136
+ health" issue** on a push to the default branch, or **one PR comment** on a pull
137
+ request. Both are updated in place rather than duplicated. `sws doctor` shows a
138
+ local "since your last run" delta from a gitignored file, which is separate from
139
+ the project trend on purpose — one person's local runs should not move the shared
140
+ number.
141
+
142
+ Publishing never fails the build. If a token or permission is missing the CLI
143
+ says so on stdout and carries on.
144
+
145
+ ## Tone
146
+
147
+ The score exists to motivate, not to judge. Report the number and the trend,
148
+ name the biggest win available, and stop. Do not moralise about a low score, do
149
+ not pad a good one with warnings, and never refuse to proceed with a task
150
+ because a check failed.
151
+
152
+ Someone who finds this obstructive stops using it, and then nothing is
153
+ compliant. That tradeoff is the whole design.
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: sws-decanter
3
+ description: Use Decanter, Stanford's design system, correctly. Use when setting up styling on a Stanford site, when asked about Stanford colors, spacing, typography or components, when Tailwind is involved, or when someone reaches for tailwind.config.js on a Stanford project.
4
+ ---
5
+
6
+ # Decanter 8
7
+
8
+ Stanford's design system. **Version 8 is CSS-first on Tailwind 4.** Version 7
9
+ was a Tailwind 3 JavaScript preset. These are architecturally different and the
10
+ difference is the single most common source of failure.
11
+
12
+ ## Install it with the beta tag, or you get v7
13
+
14
+ **Checked 2026-09-01.** `latest` is **7.5.3**, `beta` is **8.0.0-beta.0**.
15
+
16
+ ```bash
17
+ npm i decanter@beta # correct today
18
+ npm i decanter # gets 7.5.3. WRONG for new work
19
+ ```
20
+
21
+ A bare install getting v7 is the opposite of what was briefly true in August,
22
+ when the alpha sat on `latest`. Drop the tag once 8.0.0 reaches `latest`, and
23
+ record whatever resolved in `.sws/manifest.yml`.
24
+
25
+ The git form (`github:SU-SWS/decanter#v8`) appears in existing SWS projects and
26
+ is valid. Never flag it as an error.
27
+
28
+ ## The whole integration
29
+
30
+ ```css
31
+ /* src/styles/global.css */
32
+ @import 'decanter';
33
+ ```
34
+
35
+ One line — **unless the site has a form**, which needs a second import:
36
+
37
+ ```css
38
+ @import 'decanter';
39
+ @import 'decanter/forms';
40
+ ```
41
+
42
+ Omitting it silently drops `.input`, `.select`, `.textarea`, `.checkbox`,
43
+ `.radio`, `.label`, `.legend`, `.fieldset` and the global form-element reset.
44
+ Nothing errors; the form just renders unstyled. `decanter/forms` is not
45
+ standalone — import it alongside `decanter` or `decanter/minimal`.
46
+
47
+ ```js
48
+ // astro.config.mjs
49
+ import tailwindcss from '@tailwindcss/vite';
50
+ export default defineConfig({ vite: { plugins: [tailwindcss()] } });
51
+ ```
52
+
53
+ Verified working against real builds. Specifically:
54
+
55
+ - **Do not add `@import 'tailwindcss'`.** Decanter's own `index.css` already
56
+ does it. Doing both is harmless but redundant, costing about 340 bytes.
57
+ - **Do not add `@source`.** Tailwind roots source detection at the entry CSS
58
+ file's project, not at the file containing the `tailwindcss` import, so
59
+ consumer markup is found normally. Adding `@source` produces byte-identical
60
+ output. This was tested with a controlled experiment; do not re-litigate it.
61
+ - **Do not create `tailwind.config.js`.** Decanter 8 has no JS config.
62
+ Reaching for one signals a v7 mental model.
63
+ - **Do not install `@astrojs/tailwind`.** Dead package, supports neither current
64
+ Astro nor Tailwind 4. Use `@tailwindcss/vite`.
65
+ - **Do not install `tailwindcss` directly.** It arrives transitively.
66
+ - **Do not install `@tailwindcss/forms` directly.** It still arrives
67
+ transitively; in v8 only its *styles* are gated behind the `decanter/forms`
68
+ entry point (see below).
69
+
70
+ For Next, use `@tailwindcss/postcss` instead of the Vite plugin. See
71
+ `ccc-bulletin` for a working example.
72
+
73
+ ## Confirm you got v8, because v7 fails silently
74
+
75
+ ```bash
76
+ node -p "require('./node_modules/decanter/package.json').version" # expect 8.x
77
+ node -p "require('./node_modules/decanter/package.json').main" # expect src/css/index.css
78
+ ls node_modules/decanter/node_modules 2>/dev/null # expect nothing
79
+ ```
80
+
81
+ If `main` is `tailwind.config.js`, you have v7. If
82
+ `node_modules/decanter/node_modules/tailwindcss` exists, you have v7 **and** a
83
+ nested Tailwind 3 underneath a top-level Tailwind 4, which produces a build that
84
+ half works and errors that make no sense. Delete `node_modules` and the lockfile,
85
+ then reinstall.
86
+
87
+ You will also see the git form in existing SWS projects, and it is valid:
88
+
89
+ ```json
90
+ "decanter": "github:SU-SWS/decanter#v8"
91
+ "decanter": "https://github.com/SU-SWS/decanter.git#v8"
92
+ ```
93
+
94
+ Prefer the npm form for new work, since it is versioned and lockfile-friendly.
95
+ Never flag the git form as an error.
96
+
97
+ ## Where the tokens are
98
+
99
+ Decanter 8 exposes everything as CSS custom properties, readable offline with no
100
+ account or network:
101
+
102
+ ```
103
+ node_modules/decanter/src/css/theme/
104
+ colors.css Stanford Identity colors
105
+ breakpoint.css
106
+ font-family.css
107
+ font-size.css
108
+ gap.css
109
+ line-height.css
110
+ responsive-spacing.css
111
+ screen-margins.css
112
+ spacing.css
113
+ transition-duration.css
114
+ ```
115
+
116
+ **Read these files rather than guessing token names.** `decanter/colors` is also
117
+ directly importable. Components live in `src/css/components/` (button,
118
+ centered-container, form, list, logo, skiplink, stretched-link, table, wysiwyg),
119
+ utilities in `src/css/utilities/`, and custom variants in
120
+ `src/css/custom-variants.css`.
121
+
122
+ Colors follow the Stanford Identity Guide: `--color-cardinal-red` is `#8C1515`,
123
+ with `-light`, `-dark`, `-xdark`, `-xxdark` variants, plus a `black` scale from
124
+ `--color-black` (`#2E2D29`) through `--color-black-30` and similar. Use the
125
+ token, never the hex.
126
+
127
+ ## Entry points
128
+
129
+ | Import | When |
130
+ |---|---|
131
+ | `@import 'decanter'` | Default. Use this |
132
+ | `@import 'decanter/forms'` | **Required if the site has a form.** Not standalone |
133
+ | `@import 'decanter/minimal'` | Only when something else already owns base element styling, such as a Drupal theme |
134
+ | `@import 'decanter/colors'` | Tokens only |
135
+
136
+ `minimal` is **not** a reduced design system. The only difference is
137
+ `base/base-minimal.css` (623 bytes) versus `base/base.css` (3,286 bytes). Theme,
138
+ components, utilities, and variants are identical. On a fresh Astro site
139
+ `minimal` just removes resets you need.
140
+
141
+ ## Fonts and icons
142
+
143
+ Decanter ships no font assets. Import `fonts.css` for the full set or
144
+ `fonts-basic.css` for sans, serif, and the Stanford ligature logo font. Google
145
+ Fonts supplies Source Sans 3 and Source Serif 4; the logo ligature font comes
146
+ from the University Communications media CDN. **Decanter 8 dropped Roboto Slab
147
+ and Roboto Mono**: `font-slab` is gone and `font-mono` falls through to
148
+ Tailwind's system stack.
149
+
150
+ Use **Heroicons**. Do not use FontAwesome Pro: `adapt-stanford-homesite` does,
151
+ behind a licence-gated preinstall token check, and a unit site inheriting that
152
+ gets an install failure and a licence nobody mentioned.
153
+
154
+ ## Class composition
155
+
156
+ `cnbuilder` in Astro and Storyblok projects, pinned at `^3.1.0` across seven SWS
157
+ repos. The decoupled Drupal family uses `clsx` plus `tailwind-merge` instead.
158
+ Both are legitimate. Pick one per project, not per file.
159
+
160
+ ## When Decanter and something else disagree
161
+
162
+ **Decanter 8's CSS wins on token names and values.** Two specific cases:
163
+
164
+ `www.stanford.edu` does not consume Decanter. It is its own system, derived from
165
+ Decanter, and currently influencing Decanter 8. Its brand furniture is
166
+ authoritative because brand is brand, and its **tokens are a parallel
167
+ vocabulary**. Copying its CSS into a Decanter project produces something that
168
+ looks approximately right and does not use the design system, which passes
169
+ visual review and fails every token check.
170
+
171
+ `decanter.stanford.edu` and the Figma library currently document **v7**. Useful
172
+ for visual intent, not for v8 token names.
173
+
174
+ ## Migrating a v7 project
175
+
176
+ The consumption model changes entirely: `presets: [require('decanter')]` becomes
177
+ `@import 'decanter'`, and `tailwind.config.js` goes away. Tailwind 3 to 4 is a
178
+ separate migration with its own codemod.
179
+
180
+ **The class-level delta is documented.** Upstream `UPGRADE.md` has the full table
181
+ and `standards/patterns/decanter.md` reproduces it with the four traps called out.
182
+ Do not guess which utilities moved, and do not re-derive it.
183
+
184
+ The traps, in one line each: `type-N` is smaller than `text-mN` below `lg`;
185
+ `children:` → `*:` reverses variant order and the intuitive form is wrong;
186
+ `break-words` still compiles but silently loses its v7 behaviour, so switch to
187
+ `wrap-anywhere`; and `aspect-w-*` / `aspect-h-*` stop generating anything.
188
+
189
+ Also audit for `.a11y-hidden` and `.accessibility-hidden`, removed in 7.5.0.
190
+ Elements using them become **visible** rather than erroring, and if you wanted
191
+ screen-reader-only text you need `sr-only`, not a rename.
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: sws-deploy
3
+ description: Deploy a Stanford site and run the pre-launch steps. Use when setting up CI or hosting, when moving from GitHub Pages to Netlify or Vercel, when asked how to publish or go live, or when a launch checklist is needed.
4
+ ---
5
+
6
+ # Deploying, and going live
7
+
8
+ Two different jobs. Deployment is mechanical. Launch has steps no automation can
9
+ do, and those are where compliance actually lands.
10
+
11
+ ## Push to main deploys. Pull requests never required.
12
+
13
+ Trigger on both and gate only the deploy:
14
+
15
+ ```yaml
16
+ on:
17
+ push:
18
+ branches: [main]
19
+ pull_request:
20
+ workflow_dispatch:
21
+ ```
22
+
23
+ Deploy job: `if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'`
24
+
25
+ **Do not set up branch protection, required status checks, or a protected
26
+ environment beyond `github-pages`.** Each quietly converts push-to-main into a
27
+ pull-request requirement. Many campus editors work through the GitHub web UI,
28
+ which is push-to-main by construction, and they will not open a pull request to
29
+ fix a typo.
30
+
31
+ If a project already has branch protection, leave it. Someone may have added it
32
+ deliberately. Report, do not remove.
33
+
34
+ ## GitHub Pages
35
+
36
+ **To provision a repo and turn Pages on, use the `sws-github` skill** — it drives
37
+ `gh` through auth, org choice, repo creation, push, and the Pages API, so almost
38
+ nobody needs a web UI.
39
+
40
+ Two jobs, first-party actions. As of 2026-09-03 this project's own live deploy
41
+ runs `configure-pages@v6`, `upload-pages-artifact@v5`, `deploy-pages@v4`.
42
+ Artifact actions v3 are no longer supported for Pages, and
43
+ `upload-pages-artifact@v4`+ needs `deploy-pages@v4` or newer. Check the release
44
+ pages rather than trusting this line.
45
+
46
+ ```yaml
47
+ permissions:
48
+ contents: read
49
+ pages: write
50
+ id-token: write
51
+ issues: write # the persistent Site health issue
52
+ pull-requests: write # PR comment when a PR fired
53
+ concurrency:
54
+ group: pages
55
+ cancel-in-progress: false
56
+ ```
57
+
58
+ Drop `issues: write` or `pull-requests: write` and the advisory report is
59
+ produced and nobody sees it, which is worse than not running it.
60
+
61
+ Also set repo Settings → Pages → Source to **GitHub Actions**. Outside the
62
+ workflow, easy to forget.
63
+
64
+ **Two gotchas worth an afternoon each:**
65
+
66
+ 1. **`upload-pages-artifact` excludes dotfiles.** If the build output needs
67
+ `.well-known/` or similar, verify it survives or build the tar yourself.
68
+ 2. **Subpath deploys need `base`** set in the framework config, or internal
69
+ links work locally and break in production.
70
+
71
+ Pages serves **one site**, so a pull request gets checks but **no preview URL**.
72
+ Say so rather than letting someone expect previews.
73
+
74
+ ## Moving off Pages: Netlify or Vercel
75
+
76
+ **SWS runs both, one per family**, and neither is the house default:
77
+
78
+ | Family | Host | Secrets |
79
+ |---|---|---|
80
+ | `storyblok-next-netlify` (ADAPT/OOD, 6 repos) | Netlify | `netlify-plugin-vault-variables` |
81
+ | `decoupled-drupal` (Cardinal Sites, 5 repos) | Vercel | `node-vault` |
82
+
83
+ **Start from where the unit already is.** If they have a Netlify or Vercel
84
+ account, people who can log into it, and a billing arrangement that works, that
85
+ is the right host — the shared-tooling argument is real but it is worth less than
86
+ an account someone already administers. Ask before recommending.
87
+
88
+ Full profiles, with the capability each host does and does not cover, are in
89
+ `standards/hosting/`. Read those rather than reasoning from vendor marketing.
90
+
91
+ **To provision Netlify, use the `sws-netlify` skill.** Unlike `sws-github`, it
92
+ cannot be fully headless: Netlify's git-based continuous deployment needs a
93
+ GitHub App authorization, which is a browser consent screen with no API
94
+ substitute. Say so up front. **To provision Vercel, use the `sws-vercel`
95
+ skill**, which carries the same honest limit for the same reason.
96
+
97
+ Both give **per-PR preview URLs**, which is the actual reason to move off Pages
98
+ once review matters.
99
+
100
+ **Do not rank hosts, and do not introduce a third one on your own.** A new vendor
101
+ relationship is a procurement question with contractual consequences. State the
102
+ obligation, name the office, stop. See `standards/policy/procurement.md`.
103
+
104
+ **Secrets do not live in `.env` in production.** SWS uses HashiCorp Vault, via
105
+ `netlify-plugin-vault-variables` in the Storyblok family and `node-vault` in the
106
+ decoupled Drupal family. `node-vault` is the host-portable one: prefer it if you
107
+ might move hosts later.
108
+
109
+ ## Making git disappear
110
+
111
+ For non-technical units this is the actual goal, and it decides **who can
112
+ maintain the site** — which matters more than any technical detail here.
113
+
114
+ **This package is scoped to static content authored in the repo, with no CMS**
115
+ (`standards/scope.md`). So there are two paths, and the CMS is not one of them
116
+ yet:
117
+
118
+ - **GitHub web UI editing.** Edit a Markdown file, commit to `main`, the site
119
+ rebuilds. Already supported by the trigger above, and this is why nothing may
120
+ make a pull request mandatory. A real answer for a unit with one or two people
121
+ willing to edit Markdown.
122
+ - **Point them at Stanford Sites.** Free, already compliant, and someone else
123
+ maintains it. The right referral for a unit that will maintain a site alone
124
+ with no appetite for git. `astro-static` says this too.
125
+
126
+ **Raise it in discovery, not at launch.** If the unit genuinely needs a CMS, say
127
+ plainly that this package does not cover it yet rather than building half a
128
+ content backend to avoid the conversation. Eleven SWS repos are CMS-backed in
129
+ production, so the capability exists in the org — just not as a tested recipe
130
+ here.
131
+
132
+ ## Pre-launch checklist
133
+
134
+ These are the steps no CI can perform. Work through them with the person and
135
+ record dates in `.sws/manifest.yml`.
136
+
137
+ | Step | Notes |
138
+ |---|---|
139
+ | **Subdomain approved by University Communications** | Must reflect the recognised unit name. Not optional, and not fast |
140
+ | **Business owner and technical administrator recorded** | Both with valid Stanford affiliation and email, discoverable on the site |
141
+ | **HTTPS with a live certificate** | MinWeb requirement |
142
+ | **ODA accessibility review requested** | Pre-launch gate needing lead time. Raise it during the project, not the week before |
143
+ | **Manual WCAG 2.1 AA checklist completed** | Covers the ~70 percent axe cannot see |
144
+ | **Siteimprove registration submitted** | Required for public-facing sites. Google Analytics is **not** required |
145
+ | **MFA or SSO-with-MFA on all admin logins** | MinWeb requirement |
146
+ | **Data Risk Assessment** | Only if the tier is above `low`, or third-party services or personal data were introduced |
147
+ | **Privacy and Security consult** | Recommended pre-launch at moderate tier and above |
148
+ | **`sws check` reviewed** | Fix or acknowledge. Nothing blocks except secrets |
149
+
150
+ Escalate each to the right office and the right door per
151
+ `standards/policy/escalation.md`. One door with a reason, not a list.
152
+
153
+ ## Post-launch, which is not optional either
154
+
155
+ MinSec applies to low-risk static sites too. The cadence is in
156
+ `standards/policy/minsec.md`: 7 days for high-severity, 90 for the rest, monthly
157
+ scanning, quarterly inventory, quarterly privilege review. Dependabot covers part
158
+ of it. The rest is a documented runbook and a human, and it lives at the
159
+ infrastructure layer rather than in the repo.
160
+
161
+ Secure sunset matters and gets forgotten: when a site retires, remove DNS,
162
+ revoke credentials, archive or delete content, and kill dangling CNAMEs.