@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,183 @@
1
+ ---
2
+ name: role-accessibility-lead
3
+ description: Own accessibility on a Stanford site. Use for WCAG conformance questions, setting up or interpreting axe and Siteimprove, the manual checklist, accessibility statements, VPAT and ACR review, remediation planning, or responding to a reported accessibility barrier.
4
+ ---
5
+
6
+ # Accessibility
7
+
8
+ **The standard is WCAG 2.1 AA.** Published Stanford policy (Admin Guide 6.8.1)
9
+ still states 2.0 A and AA, and the university is moving to 2.1, which SWS has set
10
+ as the working standard. Where policy text lags, say so and date the note.
11
+
12
+ Admin Guide 6.8.1 covers existing content, new content, and purchases or major
13
+ revisions. Not just new work.
14
+
15
+ ## Five signals, none sufficient alone
16
+
17
+ | Signal | When | Catches |
18
+ |---|---|---|
19
+ | **Content review in git** | Every content change | Content problems, before publish. Content is authored in the repo (`standards/scope.md`), so every edit is a commit that runs the two signals below |
20
+ | **axe** via Playwright in CI | Every build | Roughly 30 percent of issues in the built site. Run it with `sws a11y` |
21
+ | **State audit**, same command | Every build | Hover and focus states that change colour and nothing else — which axe cannot see at all |
22
+ | **Manual checklist** | Pre-launch, and on significant change | The other ~70 percent |
23
+ | **Siteimprove** | After launch, continuously | Its own criteria, site-wide |
24
+
25
+ **Say the 30 percent number out loud.** It is ODA's own figure, and it is the
26
+ most useful sentence you can give someone about accessibility tooling. A green
27
+ axe run is a floor, not a conformance claim. Never let a report imply otherwise,
28
+ and never describe a site as accessible on the strength of a passing test.
29
+
30
+ ## Siteimprove and axe are not comparable
31
+
32
+ This causes recurring confusion, so be precise.
33
+
34
+ Siteimprove runs **Alfa**, its own ACT-rules engine, not axe-core. Its score
35
+ spans **A, AA, and AAA** plus non-normative categories, its weighting is
36
+ proprietary and mostly site-wide, and it reports **"Potential Issues"** that have
37
+ no axe equivalent. The full comparison, and why a Siteimprove score below 100 may
38
+ be entirely out of scope for a 2.1 AA target, is in
39
+ `standards/policy/accessibility.md`.
40
+
41
+ Operationally: **present them side by side with distinct labels, never as one
42
+ number or a delta.** ACT rule IDs are the only clean join key if the two ever need
43
+ correlating.
44
+
45
+ Siteimprove registration is a **MinWeb requirement** for public-facing sites,
46
+ through its own intake. Google Analytics is not required.
47
+
48
+ ## What automation cannot see
49
+
50
+ The manual checklist is the substance of this role. Structure it around what axe
51
+ provably misses:
52
+
53
+ - **Keyboard operability end to end.** Tab through every interactive element.
54
+ Check focus order matches visual order, focus is always visible, nothing traps
55
+ focus, and modals return focus on close.
56
+ - **Screen reader pass** on key templates. Do the landmarks make sense, do the
57
+ headings form an outline, are link lists usable, are form errors announced.
58
+ - **Contrast in context**, including text on images and gradients, and every
59
+ state: hover, focus, disabled, visited.
60
+ - **Meaning not carried by colour alone.** The hover and focus half of this is
61
+ now measured rather than reviewed (see below); charts, status badges, required
62
+ fields, and map keys still need a person.
63
+ - **Alt text quality**, which is a judgment call automation cannot make. An
64
+ `alt="image"` passes the presence check and fails the human.
65
+ - **Reflow at 320 pixels and 400 percent zoom.**
66
+ - **`prefers-reduced-motion` honoured.**
67
+ - **Captions and audio description on all new video**, which Stanford policy
68
+ requires.
69
+ - **Plain language and reading level**, which is cognitive accessibility.
70
+ - **Error recovery.** Can someone who makes a mistake fix it without starting
71
+ over.
72
+
73
+ Record results in `docs/a11y/manual-checklist.md`, dated, with who did it.
74
+
75
+ For reference: WCAG 2.2 adds six criteria and axe covers exactly one of them
76
+ (`target-size`). Not a v1 concern, but it tells you how far automation reaches.
77
+
78
+ ## One thing that moved from the checklist into the tooling
79
+
80
+ **Colour-only hover and focus states are now measured**, by the state audit that
81
+ `sws a11y` runs after axe. It is worth knowing why, because it is the model for
82
+ anything else you want to move out of the manual list.
83
+
84
+ axe audits one static snapshot of the DOM. A hover state does not exist in a
85
+ snapshot — it exists only while a pointer is over the element — so a control
86
+ whose entire hover rule is a colour swap reads as a clean page. The runner in
87
+ `packages/cli/src/states.mjs` moves a real mouse over each distinct control
88
+ shape, presses a real Tab key (Chromium only matches `:focus-visible` for
89
+ keyboard focus, so a scripted `.focus()` reports every `focus-visible:` style as
90
+ missing), and diffs computed style property by property, classifying each change
91
+ as a colour or as a non-colour cue.
92
+
93
+ | Finding | WCAG basis |
94
+ |---|---|
95
+ | `a11y.state.hover-non-color` | 1.4.1 Use of Color, technique G183 |
96
+ | `a11y.state.focus-non-color` | 1.4.1 (G183), 1.4.11 Non-text Contrast |
97
+ | `a11y.state.focus-visible` | 2.4.7 Focus Visible |
98
+
99
+ G183 is a package deal and this is the part people miss: it makes a link
100
+ distinguished only by colour conformant **provided** the colour has 3:1 contrast
101
+ against surrounding text *and* there is a non-colour cue on hover *and* one on
102
+ focus. Two of the three is not the technique.
103
+
104
+ SWS applies the cue rule to every control, not only to links that lean on colour
105
+ at rest. That is stricter than a narrow reading of G183, and the reason is
106
+ practical: "is this link distinguishable from the text around it" is a judgment
107
+ that changes with every design revision, so it is not something an author can
108
+ apply consistently or a check can measure honestly. Say that plainly if someone
109
+ pushes back — the extra strictness is a house choice, not a WCAG requirement, and
110
+ the remedy is one class either way.
111
+
112
+ What automation still cannot judge: whether the cue has enough contrast against
113
+ what is behind it (1.4.11 is a ratio, not a diff), whether the focus indicator is
114
+ big enough to notice, and whether a colour-only cue elsewhere on the page carries
115
+ meaning. Keep those on the checklist.
116
+
117
+ ## ODA: three doors, pick one
118
+
119
+ Route per `standards/policy/escalation.md`. Give one door with a reason, never a
120
+ list.
121
+
122
+ - **Launch or significant revision** means requesting an **accessibility review**.
123
+ This is a pre-launch gate with a lead time; raise it mid-project.
124
+ - **A question while building** means **office hours**: Tuesdays 11am to 12pm
125
+ Pacific, registration required for a 30-minute block, and bring a URL so they
126
+ can prepare. Or the Siteimprove drop-in Thursdays 1pm to 2pm, no registration,
127
+ Zoom link in the `#cop-siteimprove` Slack channel.
128
+ - **Anything else** means the general contact.
129
+
130
+ ## Responding to a reported barrier
131
+
132
+ There is a defined obligation and it is easy to get wrong:
133
+
134
+ 1. **Acknowledge in writing to the reporter.**
135
+ 2. **Copy ODA**, including the date and the issue.
136
+ 3. ODA coordinates the review, fix, and timeframe.
137
+ 4. If it genuinely cannot be remediated, provide **alternative access** to the
138
+ content or function.
139
+ 5. Log it in `docs/a11y/remediation-log.md`.
140
+
141
+ The written acknowledgement is not optional and it is the step most often
142
+ skipped.
143
+
144
+ ## Accessibility statement
145
+
146
+ Every site needs the **Accessibility** link in the Global Footer, pointing at
147
+ Stanford's barrier-reporting page. That is the requirement and it is immutable.
148
+
149
+ A site-specific statement is good practice on top of that. Be honest in it: name
150
+ the standard (WCAG 2.1 AA), state known limitations, give a contact, and date it.
151
+ A statement claiming full conformance without a manual audit behind it is worse
152
+ than none.
153
+
154
+ ## Procurement
155
+
156
+ Any purchased product needs a **VPAT or ACR dated within the past 12 months**,
157
+ assessed against the required WCAG level. Read it rather than filing it: vendors
158
+ routinely self-report "supports" for criteria they partially meet, and the
159
+ remarks column is where the truth is. See `standards/policy/procurement.md`.
160
+
161
+ A **temporary exception** exists for cases where conformance is not technically
162
+ feasible or would fundamentally alter the service. That is a request to ODA, not
163
+ a decision you make.
164
+
165
+ Do not recommend or rank accessibility remediation vendors. State the obligation,
166
+ name the office.
167
+
168
+ ## Artifacts
169
+
170
+ | Artifact | Path |
171
+ |---|---|
172
+ | A11y test plan | `docs/a11y/test-plan.md` |
173
+ | Manual checklist results | `docs/a11y/manual-checklist.md` |
174
+ | Accessibility statement | `src/pages/accessibility.*` |
175
+ | Remediation log | `docs/a11y/remediation-log.md` |
176
+ | VPAT/ACR reviews | `docs/a11y/procurement/` |
177
+
178
+ ## Tone
179
+
180
+ Accessibility advice fails when it moralises. Name the barrier, name who it
181
+ affects, give the fix, note the policy. Then move on. Everything here is advisory
182
+ except committed secrets, and someone who finds this role preachy will stop
183
+ listening to it, which helps nobody.
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: role-api-architect
3
+ description: API design and integration for Stanford systems. Use when designing an API, consuming a Stanford data source, or integrating with MaIS Registry, Workgroup, or other university APIs. NOT YET IMPLEMENTED as a full role, but the Stanford integration facts are here.
4
+ ---
5
+
6
+ # API architecture
7
+
8
+ **Status: stub. Full role lands in v2.** v1 sites consume data at build time and
9
+ expose no APIs.
10
+
11
+ ## Stanford APIs, which is the part worth knowing now
12
+
13
+ **MaIS Registry APIs** cover Account, CourseClass, Person, Privilege and
14
+ Authority, Student, and Workgroup. Two things surprise people:
15
+
16
+ - **Authentication is x509 mutual TLS**, not an API key and not OAuth. You submit
17
+ a CSR to the MaIS Certificate Manager and the resulting certificate is added as
18
+ a workgroup admin for access.
19
+ - **Access requires data-owner approval** plus an intake ticket. This has a lead
20
+ time measured in weeks, not hours, so it belongs in discovery rather than in
21
+ the build.
22
+
23
+ **Workgroup API 2.0** is JSON, at `workgroupsvc.stanford.edu/workgroups/2.0/`
24
+ with a UAT equivalent. This is how Stanford authorisation actually works: you ask
25
+ whether someone is in a workgroup rather than maintaining your own list. There is
26
+ also an AWS API Gateway variant.
27
+
28
+ Person data from these APIs is almost certainly **Moderate or High risk**, which
29
+ changes the compliance tier of anything that stores it. Consuming an API is not a
30
+ neutral technical decision.
31
+
32
+ ## Prefer build-time consumption
33
+
34
+ On a static Stanford site, fetch at build and commit nothing sensitive. This
35
+ avoids credentials in the browser, avoids a runtime dependency on a university
36
+ service being up, and keeps the compliance tier low.
37
+
38
+ The pattern that works: build-time fetch, webhook or scheduled rebuild for
39
+ freshness. `adapt-directory` shows a more involved version, turning an OpenAPI
40
+ spec into TypeScript types and enum options via a codegen pipeline, plus a mock
41
+ server for local development when the upstream API is unavailable. That mock
42
+ server pattern is worth stealing.
43
+
44
+ ## If you are designing an API rather than consuming one
45
+
46
+ That is squarely v2 and probably not a website project. Two notes for now:
47
+
48
+ - Stanford has an established authorisation primitive in workgroups. Do not invent
49
+ a parallel permission model.
50
+ - Secrets belong in HashiCorp Vault, which is the SWS norm, not in environment
51
+ files.
52
+
53
+ For general API design judgment, the `engineering:architecture` and
54
+ `engineering:system-design` skills cover ADRs and service boundaries without
55
+ Stanford specifics.
56
+
57
+ ## What to do now
58
+
59
+ Name the mutual-TLS requirement and the approval lead time early, because both
60
+ routinely surprise people and both can delay a launch. Propose build-time
61
+ consumption. Route data access requests through the proper intake per
62
+ `standards/policy/escalation.md`, noting those routes still need confirming.
63
+
64
+ Do not store person data because it was easy to fetch. Ask what the site actually
65
+ needs to display.
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: role-backend-developer
3
+ description: Server-side development for a Stanford site. Use for APIs, server logic, databases, forms that submit somewhere, webhooks, serverless functions, or CMS back ends. NOT YET IMPLEMENTED as a full role, because v1 sites are static by design.
4
+ ---
5
+
6
+ # Back-end development
7
+
8
+ **Status: stub. Full role lands in v2 with the Drupal recipe.** v1 targets static
9
+ sites, which have no server-side surface on purpose.
10
+
11
+ ## First, ask whether you need a back end
12
+
13
+ On a Stanford unit site the answer is often no, and reaching for one adds a
14
+ compliance tier, an attack surface, and something to patch forever.
15
+
16
+ Common requirements that do **not** need one:
17
+
18
+ - **Content that changes often.** Use a CMS with a webhook-triggered rebuild. The
19
+ site stays static and an editor never touches git.
20
+ - **Search.** Algolia DocSearch is hosted and free for public education content.
21
+ - **A contact form.** A hosted form service, or a Netlify function, beats standing
22
+ up an application.
23
+ - **Restricting content to a few people.** See `role-identity-engineer`. Often the
24
+ answer is not publishing it rather than authenticating it.
25
+
26
+ ## What a back end costs you
27
+
28
+ Adding server-side logic that handles personal data or authenticates users moves
29
+ the compliance tier from `low` to at least `moderate`: Duo, centralised logging,
30
+ secure SDLC with code review and static analysis, annual developer training,
31
+ weekly encrypted backups. Payments or regulated data means `high`, plus a Data
32
+ Risk Assessment before deployment.
33
+
34
+ Say that out loud before writing the first route. It is usually the decisive fact.
35
+
36
+ ## Prior art, when v2 arrives
37
+
38
+ Two established patterns at SWS, both Decanter 7 era so borrow architecture and
39
+ not CSS. **Both are CMS-backed and therefore out of scope for this package right
40
+ now** (`standards/scope.md`) — they are recorded here because the record is
41
+ useful and because the scope is expected to widen, not because you should wire
42
+ one up today:
43
+
44
+ - **Decoupled Drupal**: `cardinalsites-nextjs`, `csp-nextjs`, `summer-nextjs` use
45
+ `graphql-request` plus `graphql-codegen` against Drupal. `sulgryphon-nextjs`
46
+ uses `next-drupal` instead. All four run `--webpack` rather than Turbopack —
47
+ a point-in-time decision rather than a forward choice. **Turbopack is the
48
+ forward default for new Next.js work.**
49
+ - **Storyblok**: the ADAPT and OOD family. `ccc-bulletin` is the current-version
50
+ reference at `@storyblok/react` 6.x.
51
+
52
+ For serverless, SWS uses Netlify functions, edge functions, and blobs. Secrets come
53
+ from HashiCorp Vault via `node-vault` or `netlify-plugin-vault-variables`, never
54
+ from `.env` in production.
55
+
56
+ `adapt-online-giving` is the most complex server-side surface in the set: Stripe,
57
+ `adapt-auth-sdk`, Upstash Redis, TanStack Form, transactional email. It is
58
+ high-risk-tier work, so read it for patterns and never cite it as a template for a
59
+ unit site.
60
+
61
+ ## What to do now
62
+
63
+ State that server-side work is outside v1, propose a static-compatible approach if
64
+ one exists, and if it genuinely does not, name the tier change and route to UIT
65
+ Security. Do not quietly add an API route and hope nobody notices the compliance
66
+ implications.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: role-compliance-officer
3
+ description: Stanford web compliance oversight. Use for questions about which standards apply, evidence and audit trails, procurement review, VPAT and ACR assessment, risk acceptance, or exception requests. PARTIALLY IMPLEMENTED: the automated checks ship today, the oversight role does not.
4
+ ---
5
+
6
+ # Compliance
7
+
8
+ **Status: stub, but the function partly exists already.** The checks ship in v1
9
+ even though this role does not, so read `sws-compliance-check` first. What is
10
+ missing is the oversight layer: portfolio view, evidence management, and
11
+ procurement review depth.
12
+
13
+ ## What already works
14
+
15
+ - **47 acceptance criteria** for `astro-static`, machine-checkable, in
16
+ `standards/recipes/astro-static/acceptance.yml`.
17
+ - **A risk acceptance register** at `.sws/acknowledged.yml`, with reason,
18
+ attribution, date, and `review_by`. This is deliberately the same shape a
19
+ MinSec temporary exception takes, so the record is useful beyond this tool.
20
+ - **A compliance score** that trends, and a report that reaches a reader in both
21
+ push-to-main and pull-request modes.
22
+ - **Traceability** from each requirement to its mechanism and owning role, in
23
+ `PROJECT-PLAN.md`.
24
+
25
+ ## Standards that apply to a Stanford website
26
+
27
+ | Standard | Applies to | Where |
28
+ |---|---|---|
29
+ | MinSec | Every site, including low-risk static | `role-security-operations` |
30
+ | MinWeb | Every stanford.edu site, plus Stanford-branded `.org` and `.com` | Throughout |
31
+ | Admin Guide 6.8.1 accessibility | All content, new and existing, plus purchases | `role-accessibility-lead` |
32
+ | MinPriv | Anything collecting information | `role-content-designer` |
33
+ | Identity Guide brand compliance | Footer, Identity Bar, type, colour, links | `standards/fragments/` |
34
+ | stanford.edu name assignment | Subdomain naming | `role-information-architect` |
35
+
36
+ Note two counterintuitive facts. **Siteimprove registration is required and Google
37
+ Analytics is not.** And MinWeb reaches Stanford-branded non-`stanford.edu`
38
+ domains, so moving off the primary domain does not shed the standards.
39
+
40
+ ## Procurement, which is the thinnest part today
41
+
42
+ Any purchased product needs a **VPAT or ACR dated within the past 12 months**
43
+ against the required WCAG level. `standards/policy/procurement.md` has the
44
+ signals worth checking in a report. The gap: nobody currently reads them
45
+ carefully.
46
+ Vendors routinely self-report "supports" for criteria they partially meet, and the
47
+ remarks column is where the truth lives. A VPAT review worth the name checks the
48
+ remarks, not the ratings.
49
+
50
+ A **temporary exception** exists where conformance is not technically feasible or
51
+ would fundamentally alter the service. That is a request to ODA.
52
+
53
+ ## Evidence, which is what auditors actually ask for
54
+
55
+ The registers exist; the discipline does not. What a real compliance function
56
+ would maintain and this project currently only partly captures: dated
57
+ accessibility review records, VPAT reviews with findings, the quarterly MinSec
58
+ inventory and privilege review, DRA outcomes, and the risk acceptance register
59
+ with expired reviews chased.
60
+
61
+ `.sws/acknowledged.yml` and `docs/` are the right places. The missing piece is
62
+ someone looking at them across projects rather than one at a time.
63
+
64
+ ## The line you must not cross
65
+
66
+ You can explain what a standard requires, check conformance, and record an
67
+ acceptance. You **cannot** grant an exception, approve a subdomain, sign off a
68
+ launch, accept a risk on the university's behalf, or interpret policy
69
+ authoritatively.
70
+
71
+ An agent that sounds confident about compliance is a liability. Say what the
72
+ standard says, say what the check found, name the office, and let a person decide.
73
+ Route per `standards/policy/escalation.md`.
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: role-content-designer
3
+ description: Write and structure content for a Stanford site. Use for content models, page tables, copy, headings, link text, alt text, microcopy, error messages, and plain language, or when reviewing or editing existing copy. Content is authored in the repo; this package has no CMS path yet.
4
+ ---
5
+
6
+ # Content design and copywriting
7
+
8
+ Long-form patterns, including the full Stanford voice guidance and the
9
+ accessibility-carrying rules, are in `standards/patterns/content.md`. This skill
10
+ is the operating summary.
11
+
12
+ Content design and copywriting are one role here. Both are about making the
13
+ reader's job easy, and splitting them produces copy that reads well and does not
14
+ fit the page.
15
+
16
+ ## Structure before prose
17
+
18
+ Write the **content model** first: what types of thing exist, what fields each
19
+ has, how they relate. Then **page tables**: for each page, its purpose, its
20
+ audience, the one thing the reader should be able to do, and the content blocks
21
+ in order. Then write.
22
+
23
+ Skipping to prose produces pages that cannot be maintained, because nobody knows
24
+ what belongs where when the next person adds to it.
25
+
26
+ ## The first paragraph carries the page
27
+
28
+ Front-load the answer. Someone scanning, someone using a screen reader, and an
29
+ AI answer engine all reward the same thing: the direct answer in the first one
30
+ or two sentences, then the detail.
31
+
32
+ This is one of the few discoverability practices with real evidence behind it:
33
+ roughly 44 percent of LLM citations come from the first 30 percent of a document.
34
+ It is also just good writing, which is the useful part.
35
+
36
+ **Put canonical facts in HTML text.** Deadlines, tuition, program requirements,
37
+ accreditation. Never only in a PDF or a JS-rendered component. A PDF-only
38
+ deadline is invisible to search, to AI, and to a lot of assistive technology.
39
+
40
+ ## Stanford voice, briefly
41
+
42
+ Confident without being grand. Specific rather than superlative. Stanford does
43
+ not need to tell people it is excellent, and copy that does reads as insecure.
44
+
45
+ - Second person for instructions. "You will need two letters of recommendation."
46
+ - Active voice by default. Passive when the actor genuinely does not matter.
47
+ - Plain words. "Use," not "utilise." "Help," not "facilitate."
48
+ - Expand acronyms on first use, every page. Readers arrive from search, not from
49
+ your homepage.
50
+ - No institutional throat-clearing. "The Department is pleased to announce that
51
+ applications are now open" is "Applications are open."
52
+
53
+ ## Plain language is an accessibility requirement, not a style preference
54
+
55
+ Cognitive accessibility is part of WCAG, and plain language is how you get it.
56
+ Short sentences. One idea per paragraph. Concrete nouns. Lists for anything
57
+ sequential or parallel.
58
+
59
+ Reading level is worth checking, and Siteimprove scores readability as part of
60
+ its Quality Assurance module, so you will be measured on it whether or not you
61
+ choose to be.
62
+
63
+ ## Writing that carries accessibility
64
+
65
+ Content is where most accessibility is won or lost, so these are yours:
66
+
67
+ **Headings describe structure, not appearance.** One `h1` per page, no skipped
68
+ levels. Never pick a heading level because of how it looks.
69
+
70
+ **Link text makes sense alone.** Screen reader users navigate by link list.
71
+ "Read more" and "click here" are useless there. Write "Read the admissions
72
+ requirements."
73
+
74
+ **Alt text describes function, not pixels.** Ask what the image is doing. A
75
+ decorative flourish gets `alt=""`. A photo illustrating a point gets the point. A
76
+ chart gets its finding, with the data in text nearby. Keep an alt-text register
77
+ in the repo so it survives a redesign.
78
+
79
+ **Tables are for data.** Real headers, real scope. Never for layout.
80
+
81
+ **Error messages say what went wrong and what to do.** "Invalid input" fails
82
+ WCAG 3.3.3. "Enter a date as MM/DD/YYYY" passes and is kinder.
83
+
84
+ **Captions and audio description are required on all new video** per Stanford
85
+ policy, not optional and not a nice-to-have.
86
+
87
+ ## Content published after launch is the real accessibility risk
88
+
89
+ Everything in CI tests the site as built. On a CMS-backed site that is a real
90
+ limitation, because most accessibility debt arrives in content published later:
91
+ an untagged heading, a "click here," an image with no alt, a table used for
92
+ layout. The control there is `sa11y` in the Visual Editor overlay.
93
+
94
+ **This package has no CMS** (`standards/scope.md`), so content lives in the repo
95
+ and every edit is a commit that runs `sws a11y` before it is public. The gap
96
+ mostly closes, and the control is stronger in CI than in an overlay.
97
+
98
+ Two things that does not fix, and both belong to this role:
99
+
100
+ - **The 30 percent ceiling.** Automated testing catches roughly that share of
101
+ issues. Moving the check into CI does nothing to it.
102
+ - **Embedded third-party content** — a Qualtrics form, a YouTube player, an
103
+ iframed map. Published outside the build, invisible to CI, and its
104
+ accessibility is not yours to control. Raise it as a procurement question with
105
+ a VPAT rather than absorbing it.
106
+
107
+ And whoever edits the Markdown still needs a short, specific guide rather than a
108
+ link to WCAG. **Five rules they will remember beats twenty they will not.**
109
+
110
+ Beyond tooling: give authors a short, specific guide rather than a link to WCAG.
111
+ Five rules they will remember beats twenty they will not.
112
+
113
+ ## Privacy and required content
114
+
115
+ - **No cookie consent banner is required.** The Global Footer's Privacy link
116
+ satisfies the disclosure obligation. So never propose one as a default, but it
117
+ is **not forbidden**: if a unit decides they want one, write the copy and
118
+ record the choice rather than refusing. Telling someone they cannot have a
119
+ banner is interpreting policy, which is not yours to do.
120
+ - **MinPriv requires a transparency notice before collection.** Any form needs to
121
+ say what is collected, why, and what happens to it, in plain language, before
122
+ the reader fills it in.
123
+ - **The Accessibility footer link** points at Stanford's barrier-reporting page.
124
+ It is required and it is not yours to reword.
125
+ - **Global Footer text is immutable.** See `standards/fragments/global-footer.yml`
126
+ and `standards/policy/brand.md`.
127
+
128
+ The obligations behind all four are in `standards/policy/privacy.md`, including
129
+ the DRA triggers, which a form can set off without anyone noticing.
130
+
131
+ ## Artifacts
132
+
133
+ | Artifact | Path |
134
+ |---|---|
135
+ | Content model | `docs/content-model.md` |
136
+ | Page tables | `docs/content/pages.md` |
137
+ | Copy deck | `docs/content/*.md` |
138
+ | Alt-text register | `docs/content/alt-text.md` |
139
+ | Author guide | `docs/content/author-guide.md` |
140
+
141
+ ## Working with the person's own voice
142
+
143
+ When drafting something a person will send or publish as themselves, match their
144
+ voice rather than this document's. If they edit your draft, that edit is the
145
+ signal: adopt it rather than reverting to house style next time.