@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,234 @@
1
+ # Host profile: Netlify
2
+ #
3
+ # reviewed: 2026-09-03
4
+ # status: in production across the storyblok-next-netlify family (6 repos, 1 lineage).
5
+
6
+ id: netlify
7
+ name: Netlify
8
+ pairs_with: [astro-static, astro-ssr, next-ssr]
9
+ prior_art_family: storyblok-next-netlify
10
+
11
+ # ----------------------------------------------------------------- the opinion
12
+ pick_this_when: >
13
+ The unit is already on Netlify, or wants to inherit the ADAPT/OOD family's
14
+ wiring wholesale. This is the better-trodden of the two paid paths for CONTENT
15
+ sites: six repos including www.stanford.edu sit here, and the Vault secrets
16
+ plugin is a solved problem.
17
+
18
+ do_not_pick_this_when: >
19
+ The unit already administers a Vercel account. Moving them is not worth it —
20
+ see vercel.yml. Also not worth it for a purely static twelve-page site that
21
+ needs no headers and no previews; GitHub Pages is free.
22
+
23
+ # ------------------------------------------------------------------- capability
24
+ capabilities:
25
+ required:
26
+ https-live-cert: Yes, automatic, Let's Encrypt, including custom domains.
27
+ custom-domain: Yes. DNS via CNAME to the Netlify hostname.
28
+ admin-mfa: >
29
+ Available and REQUIRED BY MINWEB for the dashboard. Not on by default —
30
+ enable it and attest to it. Team-level SSO where the account supports it.
31
+ no-committed-secrets: >
32
+ netlify-plugin-vault-variables, pulling from HashiCorp Vault at build
33
+ time. This is the family convention; follow it rather than introducing a
34
+ new pattern. Netlify's own environment variable UI works but leaves the
35
+ value outside Vault.
36
+ named-admin-access: >
37
+ Team membership. Watch for sites deployed from an individual's personal
38
+ account rather than the team — that is the failure mode here.
39
+ sunsettable: Delete the site, then remove the DNS record.
40
+ recommended:
41
+ security-headers-default: >
42
+ Yes, two ways. Ship the default set from capabilities.yml.
43
+ csp: >
44
+ OFF by default per capabilities.yml -- the plugin ecosystem removes some
45
+ of the implementation cost of adding one, not the support cost of a page
46
+ an owner cannot un-break.
47
+ preview-urls: Yes, per pull request. The main reason to move off Pages.
48
+ redirects: >
49
+ Yes, netlify.toml [[redirects]] or a _redirects file. Full support
50
+ including splats, query params, and status codes.
51
+ cms-rebuild-webhook: >
52
+ DEFERRED, not missing. Build hooks work and are well-trodden here, but
53
+ this package has no CMS to fire them. See standards/scope.md.
54
+ server-runtime: >
55
+ Yes. Functions, edge functions, blobs, and @netlify/plugin-nextjs for
56
+ full Next support. All in production use in this family.
57
+
58
+ # ---------------------------------------------------------------------- how to
59
+ adapters:
60
+ astro: "@astrojs/netlify"
61
+ next: "@netlify/plugin-nextjs"
62
+ note: Install latest. Do not pin. See standards/stack/reference-versions.yml.
63
+
64
+ headers:
65
+ static_mechanism: |
66
+ # netlify.toml — works for astro-static and astro-ssr alike.
67
+ [[headers]]
68
+ for = "/*"
69
+ [headers.values]
70
+ Strict-Transport-Security = "max-age=31536000; includeSubDomains; preload"
71
+ X-Content-Type-Options = "nosniff"
72
+ Referrer-Policy = "origin-when-cross-origin"
73
+ Permissions-Policy = "geolocation=(), camera=(), microphone=(), midi=(), payment=(), usb=()"
74
+ X-Frame-Options = "SAMEORIGIN"
75
+ next_mechanism: >
76
+ On Next, prefer headers() in next.config.ts so the config travels with the
77
+ app rather than living in host config. @netlify/plugin-nextjs honours it.
78
+ Gate on the deploy environment if it fights local development.
79
+ precedence_gotcha: >
80
+ If you set the same header in BOTH netlify.toml and next.config.ts, the
81
+ netlify.toml value wins on Netlify. Pick one place. Two places is how a
82
+ header ends up with a value nobody in the repo wrote.
83
+
84
+ deploy:
85
+ trigger: >
86
+ Push to main deploys. Netlify's git integration handles this; the GitHub
87
+ Actions workflow is then for checks only, not for deploying.
88
+ config_file: netlify.toml
89
+
90
+ prior_art:
91
+ - repo: adapt-stanford-homesite
92
+ ref: dev
93
+ for: >
94
+ THE reference for this host. Vault variables and environment detection.
95
+ Read its Netlify-specific wiring; do NOT read its CSS or copy FontAwesome Pro.
96
+ - repo: ccc-bulletin
97
+ ref: dev
98
+ for: >
99
+ Netlify blobs, edge functions, and functions on a Decanter 8 project.
100
+ Closest thing to next-ssr in production.
101
+ - repo: ood-giving-campaign
102
+ ref: dev
103
+ for: >
104
+ A small campaign site on this host. Closest in scope to a unit site.
105
+ NOTE: like the rest of this family it is Storyblok-backed, which is out of
106
+ scope here. Read it for host wiring and site shape, not for content
107
+ plumbing. See standards/scope.md.
108
+
109
+ gotchas:
110
+ - >
111
+ The homesite gates its headers on being on Netlify and returns [] locally.
112
+ Copy that, or spend a day fighting your own CSP in development.
113
+ - >
114
+ Do not import the homesite's two-CSP-policy pattern. It exists so a CMS
115
+ Visual Editor can iframe the site while the app cannot, and there is no CMS
116
+ in scope here. The SAMEORIGIN default from capabilities.yml is enough.
117
+ - >
118
+ Deploying from an individual's personal Netlify account rather than a team
119
+ breaks the named-admin-access requirement the day that person leaves.
120
+
121
+ # ------------------------------------------------------------------ provisioning
122
+ # The agent-run path, for a project that has already decided Netlify per the
123
+ # table above. NOT VERIFIED against a live deploy the way github-pages.yml's
124
+ # steps are: no project in this repo runs Netlify yet. Treat every step as
125
+ # reasoned from the Netlify CLI's own --help output and documentation, and from
126
+ # how the ADAPT/OOD family is shaped -- not as proven. Correct this file the
127
+ # first time someone actually runs it. The `sws-netlify` skill drives these in
128
+ # order.
129
+ #
130
+ # THE SHAPE IS DIFFERENT FROM GITHUB PAGES, and that difference is the thing to
131
+ # get right rather than paper over: `gh` can do the entire GitHub-side job
132
+ # headlessly, because a GitHub PAT or OAuth grant is enough to create a repo,
133
+ # push, and flip on Pages. Netlify's git-based continuous deployment instead
134
+ # needs the Netlify account to hold a GitHub App authorization scoped to the
135
+ # repo, and granting that is an OAuth consent screen -- there is no API call
136
+ # that substitutes for it. requirements.yml already reflects this: netlify-cli
137
+ # is `optional`, because deploy comes from the git integration, not the CLI.
138
+ provisioning:
139
+ prerequisite:
140
+ run: |
141
+ npx sws preflight # then install what it names, then run it again
142
+ needs: >
143
+ git, mandatory regardless of host (same reasoning as github-pages.yml).
144
+ The Netlify CLI (`netlify-cli`, binary `netlify`) is OPTIONAL here --
145
+ useful for env vars, verification, and a manual first deploy, but not
146
+ required to make push-to-main deploy.
147
+ the_decision: >
148
+ Use the CLI where it helps (env vars, verification) and the dashboard
149
+ where the CLI cannot substitute for it (the GitHub App authorization).
150
+ There is no MCP-server alternative worth adding: the one step that
151
+ genuinely needs a browser needs it regardless of transport.
152
+ version_floor: Anything current. Install latest; do not pin.
153
+
154
+ steps:
155
+ - id: auth
156
+ what: Authenticate. Opens a browser; there is no headless flow.
157
+ run: |
158
+ netlify status || netlify login
159
+ note: >
160
+ `netlify login` opens an OAuth flow in a browser and stores the token in
161
+ the CLI's own global config, not in the project. `netlify status` first
162
+ makes a re-run a no-op, same reasoning as `gh auth status`.
163
+ honest_limit: >
164
+ Creating a NETLIFY ACCOUNT, as opposed to logging into an existing one,
165
+ needs a browser and cannot be scripted -- the same shape of limit as
166
+ GitHub account creation in github-pages.yml.
167
+
168
+ - id: choose-team
169
+ what: Decide which team owns the site. Ask; do not assume.
170
+ note: >
171
+ PREFER A TEAM, NOT A PERSONAL ACCOUNT, for the same reason as
172
+ github-pages.yml's choose-owner step: a site whose only deploy access
173
+ belongs to one person breaks named-admin-access the day that person
174
+ leaves. If they have no team access, that is an escalation, not
175
+ something to work around -- see standards/policy/escalation.md.
176
+
177
+ - id: create-and-connect
178
+ what: >
179
+ Create the site AND connect it to the GitHub repo for continuous
180
+ deployment, in one interactive run.
181
+ run: |
182
+ netlify init
183
+ note: >
184
+ `netlify init`, run from inside the repo, asks whether to create a new
185
+ site or link an existing one, then which team, then walks the GitHub
186
+ App authorization if the team has not already granted it for this repo,
187
+ then asks for the build command and publish directory. THIS is the step
188
+ that opens a browser for the git-provider consent screen -- say so
189
+ before running it rather than letting a window appear unexplained.
190
+ Once the team's GitHub App grant already covers new repos in that org,
191
+ later projects skip the consent screen entirely.
192
+ honest_limit: >
193
+ NOT VERIFIED end to end. Reasoned from `netlify init --help` and
194
+ Netlify's own continuous-deployment documentation.
195
+
196
+ - id: build-config
197
+ what: Commit `netlify.toml` for build settings and headers.
198
+ source: standards/recipes/astro-ssr/RECIPE.md, step 8b
199
+ note: >
200
+ Prefer config that travels with the repo over dashboard settings, for
201
+ the same reason secrets go in Vault rather than a host UI: it survives
202
+ a dashboard reorganisation and a person leaving. Reserve
203
+ `netlify env:set` for values that must not be committed, and prefer
204
+ `netlify-plugin-vault-variables` per the family convention over
205
+ hand-set dashboard values -- see `no-committed-secrets` above.
206
+
207
+ - id: verify
208
+ what: Confirm the deploy, and check what MinWeb asks for while you are here.
209
+ run: |
210
+ netlify open
211
+ netlify api getSite --data '{"site_id": "<site-id>"}'
212
+ note: >
213
+ Unlike `gh api repos/.../pages`, which returns a boolean
214
+ `https_enforced`, Netlify's automatic HTTPS is close to unconditional
215
+ for a site on a Netlify-managed domain or a correctly CNAMEd custom one
216
+ -- but that claim is reasoned here, not read back from a live API
217
+ response. Confirm the certificate is actually live on first real use.
218
+
219
+ what_this_does_not_do:
220
+ - Approve the stanford.edu subdomain. University Communications, with a lead time.
221
+ - Request the ODA accessibility review. Pre-launch gate, needs lead time.
222
+ - Register with Siteimprove. Required for public sites, its own intake.
223
+ - Attest MFA on the Netlify team dashboard. An administrative login under MinWeb.
224
+ - Name the business owner and technical administrator in .sws/manifest.yml.
225
+ - >
226
+ Wire up netlify-plugin-vault-variables end to end. That is a Vault
227
+ credential exchange the unit's Vault administrator has to grant, not
228
+ something this CLI sequence can provision alone.
229
+
230
+ procurement: >
231
+ An existing SWS vendor relationship, so nothing new to procure for a project
232
+ joining an existing team account. A NEW account with a new billing
233
+ arrangement is a procurement question: state the obligation, name the office,
234
+ stop. See standards/policy/procurement.md.
@@ -0,0 +1,284 @@
1
+ # Host profile: Vercel
2
+ #
3
+ # reviewed: 2026-09-03
4
+ # status: in production across the decoupled-drupal family (5 repos, 1 lineage).
5
+ #
6
+ # NOTE ON THIS FILE'S HISTORY: until 2026-09-03 this project's standards said
7
+ # Vercel "appears once across eleven repos" and called it a swap that costs you
8
+ # the shared tooling. Both statements were wrong. Vercel carries library.stanford.edu,
9
+ # the Cardinal Sites front end, and sup.org. See standards/prior-art/repos.yml,
10
+ # ANSWERED block H1.
11
+
12
+ id: vercel
13
+ name: Vercel
14
+ pairs_with: [astro-static, astro-ssr, next-ssr]
15
+ prior_art_family: decoupled-drupal
16
+
17
+ # ----------------------------------------------------------------- the opinion
18
+ pick_this_when: >
19
+ The unit is already on Vercel, or the project is a decoupled Drupal front end
20
+ and wants to inherit the Cardinal Sites family's wiring. Five SWS repos sit
21
+ here including library.stanford.edu, so this is well-trodden ground, not a
22
+ detour. It is also the most natural home for a Next project: the framework and
23
+ the platform ship from the same vendor, so Next features tend to work on
24
+ release day rather than after an adapter catches up.
25
+
26
+ do_not_pick_this_when: >
27
+ The unit already administers a Netlify account. Neither host is the house
28
+ default and moving a team between them buys nothing.
29
+
30
+ # ------------------------------------------------------------------- capability
31
+ capabilities:
32
+ required:
33
+ https-live-cert: Yes, automatic, including custom domains.
34
+ custom-domain: >
35
+ Yes. CHECK THIS ONE: press-nextjs currently publishes to
36
+ stanford-university-press.vercel.app, and a *.vercel.app URL is a preview
37
+ domain, not an approved Stanford subdomain. Fine pre-launch, not fine at
38
+ launch.
39
+ admin-mfa: >
40
+ Available and REQUIRED BY MINWEB for the dashboard. Not on by default.
41
+ Enable it and attest to it on the launch checklist.
42
+ no-committed-secrets: >
43
+ node-vault, reading from HashiCorp Vault in application code. This is the
44
+ family convention AND the host-portable one, since it does not depend on a
45
+ host build plugin. Prefer it over the Vercel environment variable UI, and
46
+ prefer it generally if the project might change hosts.
47
+ named-admin-access: >
48
+ Team membership. Same failure mode as Netlify: a site deployed from a
49
+ personal account rather than the team.
50
+ sunsettable: Delete the project, then remove the DNS record.
51
+ recommended:
52
+ security-headers-default: >
53
+ Yes, and THIS IS THE GAP TO CLOSE. No repo in the Vercel family sets any
54
+ security headers: sulgryphon-nextjs's headers() sets only X-Robots-Tag for
55
+ non-production, and its vercel.json has redirects and rewrites but no
56
+ headers key at all. That is PERMITTED — MinWeb requires no headers — but it
57
+ means new work here should ship the default set from capabilities.yml
58
+ rather than copy the family. See below for the config.
59
+ csp: >
60
+ Hand-rolled: there is no first-party plugin for it. Still OFF by default
61
+ per capabilities.yml, and here the implementation cost is real on top of
62
+ support cost.
63
+ preview-urls: Yes, per pull request, and the best-in-class version of it.
64
+ redirects: >
65
+ Yes, vercel.json. sulgryphon-nextjs is the reference and worth copying
66
+ wholesale for any site replacing a legacy Drupal or WordPress install.
67
+ cms-rebuild-webhook: >
68
+ DEFERRED, not missing. Deploy hooks work; this package has no CMS to fire
69
+ them. See standards/scope.md.
70
+ server-runtime: >
71
+ Yes, and the strongest of the three. ISR, route handlers, image
72
+ optimization, and Next features generally land here first.
73
+
74
+ # ---------------------------------------------------------------------- how to
75
+ adapters:
76
+ astro: "@astrojs/vercel"
77
+ next: none needed. First-party.
78
+ note: Install latest. Do not pin.
79
+
80
+ headers:
81
+ mechanism: >
82
+ Prefer headers() in next.config.ts (or the Astro adapter's config) so the
83
+ policy travels with the app. vercel.json's headers array is the alternative
84
+ and is right for a static build with no framework config.
85
+ vercel_json_mechanism: |
86
+ // vercel.json — for astro-static, or when you want it in host config.
87
+ {
88
+ "headers": [
89
+ {
90
+ "source": "/(.*)",
91
+ "headers": [
92
+ {"key": "Strict-Transport-Security", "value": "max-age=31536000; includeSubDomains; preload"},
93
+ {"key": "X-Content-Type-Options", "value": "nosniff"},
94
+ {"key": "Referrer-Policy", "value": "origin-when-cross-origin"},
95
+ {"key": "Permissions-Policy", "value": "geolocation=(), camera=(), microphone=(), midi=(), payment=(), usb=()"},
96
+ {"key": "X-Frame-Options", "value": "SAMEORIGIN"}
97
+ ]
98
+ }
99
+ ]
100
+ }
101
+ precedence_gotcha: >
102
+ vercel.json headers and next.config.ts headers() BOTH apply and are not
103
+ merged predictably when they collide. Pick one place.
104
+
105
+ deploy:
106
+ trigger: >
107
+ Push to main deploys, via the git integration. GitHub Actions is then for
108
+ checks only.
109
+ config_file: vercel.json
110
+ build_note: >
111
+ sulgryphon-nextjs sets buildCommand "yarn build --webpack" and installCommand
112
+ "yarn workspaces focus --production" in vercel.json. The --webpack flag is a
113
+ point-in-time decision, NOT guidance: Turbopack is the forward default, and
114
+ press-nextjs has already dropped the flag.
115
+
116
+ prior_art:
117
+ - repo: sulgryphon-nextjs
118
+ ref: 1.x
119
+ public: true
120
+ for: >
121
+ THE reference for this host, and readable without access since it is
122
+ public and MIT licensed. Its vercel.json is the best legacy-redirect
123
+ example in the set: nine rules catching /node/*, /taxonomy/*, /wp-content/*,
124
+ *.php, *.htm* and *.sh, plus three rewrites to discover.stanford.edu.
125
+ Also carries proxy.ts, a honeypot bot filter on /all — note that this is
126
+ NOT a CSP implementation, in case the filename suggests otherwise.
127
+ - repo: press-nextjs
128
+ ref: 1.x
129
+ public: true
130
+ for: >
131
+ The NEWEST member of the family, so cite it over its siblings for current
132
+ practice. First in the set to drop --webpack. sup.org is also the live
133
+ MinWeb example of a Stanford-branded non-stanford.edu domain.
134
+ - repo: cardinalsites-nextjs
135
+ ref: 1.x
136
+ for: >
137
+ Decoupled Drupal via graphql-codegen, the SAML reference via passport-saml,
138
+ and node-vault secret retrieval.
139
+
140
+ prior_art_note: >
141
+ All five are Decanter 7 and Tailwind 3. Read them for hosting, redirects, data
142
+ fetching, and secrets. NEVER for CSS.
143
+
144
+ gotchas:
145
+ - >
146
+ Do not copy the family's header posture. It has none. Copying it is how a
147
+ "follow prior art" instinct produces a site with weaker defaults than the
148
+ recipe intends.
149
+ - >
150
+ A *.vercel.app production URL is not an approved Stanford subdomain. The
151
+ subdomain name is University Communications' decision, has a lead time, and
152
+ is not something this tool or a developer can approve.
153
+ - >
154
+ Deploying from an individual's personal Vercel account rather than the team
155
+ breaks named-admin-access the day that person leaves.
156
+
157
+ # ------------------------------------------------------------------ provisioning
158
+ # The agent-run path, for a project that has already decided Vercel per the
159
+ # table above. NOT VERIFIED against a live deploy: no project in this repo runs
160
+ # Vercel yet, the same disclaimer standards/hosting/netlify.yml carries. Treat
161
+ # every step as reasoned from the Vercel CLI's own --help output and
162
+ # documentation and from how the decoupled-drupal family is shaped -- not as
163
+ # proven. Correct this file the first time someone actually runs it. The
164
+ # `sws-vercel` skill drives these in order.
165
+ #
166
+ # THE SAME SHAPE OF LIMIT AS NETLIFY, for the same underlying reason: Vercel's
167
+ # git integration also runs through a GitHub App, and installing that app for
168
+ # an account or org the first time is a browser consent screen with no API
169
+ # substitute -- `vercel git connect` assumes the app grant already exists or
170
+ # walks you to get it. requirements.yml already reflects this: vercel-cli is
171
+ # `optional`, because deploy comes from the git integration, not the CLI.
172
+ provisioning:
173
+ prerequisite:
174
+ run: |
175
+ npx sws preflight # then install what it names, then run it again
176
+ needs: >
177
+ git, mandatory regardless of host. The Vercel CLI (`vercel-cli`, binary
178
+ `vercel`) is OPTIONAL here, same as netlify-cli -- useful for env vars,
179
+ verification, and a manual first deploy, but not required to make
180
+ push-to-main deploy.
181
+ the_decision: >
182
+ Use the CLI where it helps (linking, env vars, verification) and the
183
+ dashboard where the CLI cannot substitute for it (the first GitHub App
184
+ grant for a team that has never connected a repo before). No MCP-server
185
+ alternative is worth adding, same reasoning as Netlify: the one step that
186
+ genuinely needs a browser needs it regardless of transport.
187
+ version_floor: Anything current. Install latest; do not pin.
188
+
189
+ steps:
190
+ - id: auth
191
+ what: Authenticate. Opens a browser; there is no headless flow.
192
+ run: |
193
+ vercel whoami || vercel login
194
+ note: >
195
+ `vercel login` supports email OTP or browser SSO and stores the token
196
+ in the CLI's own global config, not in the project. `vercel whoami`
197
+ first makes a re-run a no-op, same reasoning as `gh auth status` and
198
+ `netlify status`.
199
+ honest_limit: >
200
+ Creating a VERCEL ACCOUNT, as opposed to logging into an existing one,
201
+ needs a browser and cannot be scripted -- the same shape of limit as
202
+ GitHub account creation in github-pages.yml.
203
+
204
+ - id: choose-team
205
+ what: Decide which team owns the project. Ask; do not assume.
206
+ run: |
207
+ vercel teams ls
208
+ note: >
209
+ PREFER A TEAM, NOT A PERSONAL ACCOUNT, same reasoning as
210
+ github-pages.yml's choose-owner and netlify.yml's choose-team: a site
211
+ whose only deploy access belongs to one person breaks
212
+ named-admin-access the day that person leaves. If they have no team
213
+ access, that is an escalation, not something to work around -- see
214
+ standards/policy/escalation.md.
215
+
216
+ - id: link-project
217
+ what: Link the local working directory to a new or existing Vercel project.
218
+ run: |
219
+ vercel link --yes --scope <team-slug>
220
+ note: >
221
+ `--yes` accepts Vercel's detected framework defaults rather than
222
+ prompting for each one, which is what makes this step scriptable where
223
+ the next one is not. Creates `.vercel/project.json` locally; add it to
224
+ `.gitignore` -- it is a machine-local pointer, not project config.
225
+ honest_limit: NOT VERIFIED. Reasoned from `vercel link --help`.
226
+
227
+ - id: connect-repo
228
+ what: >
229
+ Connect the project to the GitHub repo for continuous deployment. THE
230
+ STEP THAT CAN NEED A BROWSER, same shape as `netlify.yml`'s
231
+ connect-repo and GitHub account creation in github-pages.yml -- name it
232
+ rather than pretending around it.
233
+ run: |
234
+ vercel git connect
235
+ note: >
236
+ Works without a browser prompt once the team's Vercel-for-GitHub App
237
+ already covers this repo's org. For a team's FIRST repo, it walks the
238
+ GitHub App installation, which is an OAuth consent screen with no API
239
+ substitute. Tell the person this is coming before running it.
240
+ honest_limit: >
241
+ NOT VERIFIED end to end. Reasoned from `vercel git connect --help` and
242
+ Vercel's own Git integration documentation.
243
+
244
+ - id: build-config
245
+ what: Commit `vercel.json` for headers, redirects, and build overrides.
246
+ source: standards/recipes/astro-ssr/RECIPE.md, step 8b
247
+ note: >
248
+ Prefer config that travels with the repo over dashboard settings, for
249
+ the same reason secrets go in Vault rather than a host UI. Reserve
250
+ `vercel env add` for values that must not be committed, and prefer
251
+ `node-vault` -- the host-portable option and the decoupled-drupal
252
+ family convention -- over hand-set dashboard values. See
253
+ `no-committed-secrets` above.
254
+
255
+ - id: verify
256
+ what: Confirm the deploy, and check what MinWeb asks for while you are here.
257
+ run: |
258
+ vercel project ls
259
+ vercel inspect <deployment-url>
260
+ note: >
261
+ Same caveat as Netlify: there is no single boolean confirmed here
262
+ against a live API response the way `gh api .../pages` returns
263
+ `https_enforced`. Vercel's automatic HTTPS is close to unconditional for
264
+ a Vercel-managed or correctly CNAMEd custom domain, but confirm the
265
+ certificate is actually live on first real use. Also confirm the
266
+ production URL is not still a bare `*.vercel.app` preview domain -- see
267
+ the custom-domain gotcha above.
268
+
269
+ what_this_does_not_do:
270
+ - Approve the stanford.edu subdomain. University Communications, with a lead time.
271
+ - Request the ODA accessibility review. Pre-launch gate, needs lead time.
272
+ - Register with Siteimprove. Required for public sites, its own intake.
273
+ - Attest MFA on the Vercel team dashboard. An administrative login under MinWeb.
274
+ - Name the business owner and technical administrator in .sws/manifest.yml.
275
+ - >
276
+ Wire up node-vault end to end. That is a Vault credential exchange the
277
+ unit's Vault administrator has to grant, not something this CLI sequence
278
+ can provision alone.
279
+
280
+ procurement: >
281
+ An existing SWS vendor relationship, so a project joining an existing team
282
+ account has nothing new to procure. A NEW account, or a new billing
283
+ arrangement, is a procurement question. State the obligation, name the
284
+ office, stop. See standards/policy/procurement.md.
@@ -0,0 +1,162 @@
1
+ # Components
2
+
3
+ How SWS builds components, and the one structural decision that surprises people.
4
+
5
+ ## No component workshop. Deliberately.
6
+
7
+ **This project ships no Storybook, no browsable component library, no workshop
8
+ build target.**
9
+
10
+ The reasoning: most unit sites have a handful of components and exactly **one
11
+ consumer**. A workshop costs more to maintain than it returns at that scale, and
12
+ it becomes a second build to keep green.
13
+
14
+ What replaces it: a **component inventory** as a document. What components exist,
15
+ what variants, where each is used. That gives you the reuse conversation without
16
+ a build target.
17
+
18
+ `docs/components.md`, shared between `role-ux-designer` and
19
+ `role-frontend-developer`.
20
+
21
+ **When the decision would flip:** a component set with genuine multi-project
22
+ reuse. `adapt-stanford-homesite` runs Storybook with the a11y addon, plus Cypress
23
+ e2e and component tests, Jest, and MSW mocking. That is what thorough looks like
24
+ at flagship scale. Read it for reference, not as a shopping list.
25
+
26
+ If component-level a11y assertions are needed, **Vitest plus `axe-core`** gets
27
+ there without a workshop.
28
+
29
+ ## Semantic HTML is the whole accessibility foundation
30
+
31
+ **Most accessibility failures are a `div` that should have been a `button`.**
32
+
33
+ - **Real elements before ARIA.** A `button` is focusable, keyboard-operable, and
34
+ announced correctly for free. `<div role="button">` needs `tabindex`, key
35
+ handlers, and still behaves worse.
36
+ - **Landmarks on every page**: `header`, `nav`, `main`, `footer`. One `main`.
37
+ - **One `h1`**, no skipped levels. **Heading level is structure, not size.**
38
+ - **Lists for lists**, including navigation.
39
+ - **ARIA only when no element exists.** Bad ARIA is worse than none, and the
40
+ first rule of ARIA is not to use it.
41
+ - **Tables are for data.** Real headers, real scope. Never for layout.
42
+
43
+ For genuinely complex widgets (combo boxes, date pickers), reach for a headless
44
+ library. `sulgryphon-nextjs` uses `react-aria` and is the strongest accessibility
45
+ signal across the SWS repos.
46
+
47
+ **There is no house headless library, and that is confirmed rather than
48
+ assumed** (asked of SWS, 2026-09-01). `react-aria`, `@base-ui/react`, MUI and
49
+ headlessui are all in use across SWS repos, and no choice has been made between
50
+ them. Pick one per project rather than mixing.
51
+
52
+ That absence is worth understanding rather than filling in. This is the layer
53
+ where accessibility is usually won or lost, so with no house choice to lean on,
54
+ **the guidance in this project is the control** — which is a large part of why it
55
+ exists. When you pick a library, judge it on keyboard behaviour, focus
56
+ management, and announced state, and say which of those you checked. Do not
57
+ declare a house standard on the org's behalf; that is not an agent's call.
58
+
59
+ ## Naming and composition
60
+
61
+ **Class composition:** `cnbuilder` on Astro and Storyblok projects, pinned at
62
+ `^3.1.0` across seven SWS repos. The decoupled Drupal family uses `clsx` plus
63
+ `tailwind-merge`. Both are legitimate conventions; pick one per project, not per
64
+ file. See [`decanter.md`](decanter.md).
65
+
66
+ **Styling:** tokens from Decanter, never hardcoded hex. Never remove a focus
67
+ outline without replacing it with something better — that is the single most
68
+ common regression in a redesign.
69
+
70
+ **Icons:** Heroicons.
71
+
72
+ ## Motion
73
+
74
+ Entry motion belongs to the block, not the component: wrap it at the call site
75
+ with `data-animate` (or `AnimateInView`) rather than baking an animation into
76
+ every component. That keeps the set of motions on a site finite and lets a
77
+ reviewer see it in one place.
78
+
79
+ State motion — hover, focus, active, open — belongs in the component's CSS, is
80
+ capped at 200ms, and must not move layout. See [`motion.md`](motion.md).
81
+
82
+ ## Hover and focus must change more than colour
83
+
84
+ **A state whose only change is a colour is not a state for a lot of readers.**
85
+ Every hover and focus state needs one cue that survives monochrome: an
86
+ underline, an outline, a border width, a weight, a shape.
87
+
88
+ For text links and buttons the answer is nearly always an underline, in whichever
89
+ direction the rest state leaves free:
90
+
91
+ | Rest state | Hover and focus |
92
+ |---|---|
93
+ | `no-underline` | `hocus:underline` |
94
+ | `underline` | `hocus:no-underline` |
95
+ | Colour change you want to keep | Keep it, and add the underline as well |
96
+ | Icon or image control, no text | `hocus:outline`, a border width, or a shape change — an underline has nothing to draw on |
97
+
98
+ `hocus:` is the Decanter variant covering hover and focus together; plain
99
+ Tailwind is `hover: focus-visible:`. Where the underline belongs on an inner
100
+ element rather than the whole control — a wordmark next to a badge, say — put
101
+ `group` on the control and `group-hover:underline group-focus:underline` on the
102
+ text.
103
+
104
+ Two things that look like cues and are not: a `filter: brightness()` shift, and
105
+ an opacity change that dims rather than reveals. Both are colour.
106
+
107
+ `sws a11y` measures this with a real mouse and a real Tab key, so it is checked
108
+ rather than reviewed: `a11y.state.hover-non-color`,
109
+ `a11y.state.focus-non-color`, `a11y.state.focus-visible`. The reasoning and the
110
+ WCAG basis are in
111
+ [`../policy/accessibility.md`](../policy/accessibility.md#state-feedback-must-not-be-colour-alone).
112
+
113
+ ## Design the states, not the happy path
114
+
115
+ A component is not done when it renders the expected content. Cover:
116
+
117
+ - loading
118
+ - empty
119
+ - error
120
+ - too much content
121
+ - too little content
122
+ - the longest plausible name
123
+ - the unit that provided almost nothing
124
+
125
+ That last one is the realistic case on a Stanford unit site, and it is the one
126
+ that gets skipped. Record the inventory in `docs/design/states.md`.
127
+
128
+ ## Astro-specific composition
129
+
130
+ **Default to zero JavaScript.** Astro components render to HTML with no runtime.
131
+ Only add an island when something genuinely needs interactivity, and use the
132
+ narrowest directive that works: `client:visible` over `client:load`,
133
+ `client:idle` over `client:load`.
134
+
135
+ **Content collections** for anything repeated: news, people, programs, events.
136
+ Define a schema and get type safety and validation. Hand-maintained arrays of
137
+ frontmatter drift.
138
+
139
+ `sws-astro` is the reference for config, eslint, and island composition.
140
+
141
+ ## Images and fonts inside components
142
+
143
+ - Use the framework's image component for local images: dimensions, lazy loading,
144
+ modern formats.
145
+ - **Always set width and height, or an explicit aspect ratio.** This prevents
146
+ layout shift, and it is a component-level concern rather than a page-level one.
147
+ - Under Next static export the default image loader does not work; you need a
148
+ custom one.
149
+ - Preload the one or two font faces above the fold, let the rest load normally.
150
+ `font-display: swap` unless you have a reason.
151
+
152
+ ## What to look for in review
153
+
154
+ The list that catches most of what actually goes wrong:
155
+
156
+ 1. The `div` that should be a `button`.
157
+ 2. A hardcoded Stanford hex.
158
+ 3. A removed focus outline, or a hover state that is only a colour change.
159
+ 4. An island that did not need to be one.
160
+ 5. An image without dimensions.
161
+ 6. A heading level chosen for its size.
162
+ 7. A component that only handles the happy path.