@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,215 @@
1
+ # What a Stanford site needs from a host
2
+ #
3
+ # reviewed: 2026-09-03
4
+ #
5
+ # This is the platform-agnostic half of the hosting story. Recipes declare which
6
+ # capabilities they need; the host profiles in this directory say how each host
7
+ # meets them and what it costs. Acceptance criteria assert the OUTCOME
8
+ # ("a canonical URL is emitted"), never the vendor mechanism ("netlify.toml
9
+ # exists"), which is what keeps recipes portable.
10
+ #
11
+ # ==============================================================================
12
+ # THE THING TO GET RIGHT ABOUT THIS FILE
13
+ #
14
+ # MinWeb requires NO RESPONSE HEADERS. Not CSP, not HSTS, none. Read
15
+ # standards/policy/minweb.md and count: named owner, named technical admin, MFA
16
+ # on admin logins, HTTPS with a live certificate, no credentials in Git,
17
+ # approved subdomain, exact Global Footer, accessibility barrier link,
18
+ # Siteimprove registration, DNS audits. That is the list.
19
+ #
20
+ # So `required` below is short, and almost every host clears it. Hosting is
21
+ # therefore NOT where compliance is won or lost, and a recipe that implies
22
+ # otherwise is overreaching. The `recommended` block is where most of the
23
+ # engineering value sits, and it is advisory in the ordinary way: report, offer
24
+ # a fix, move on.
25
+ #
26
+ # Confirmed by SWS 2026-09-03: CSP is a NICE-TO-HAVE.
27
+ # ==============================================================================
28
+
29
+ version: 1
30
+
31
+ required:
32
+ - id: https-live-cert
33
+ what: HTTPS served with a valid, auto-renewing certificate.
34
+ policy: minweb
35
+ why: >
36
+ MinWeb requirement, and the one hosting fact that is genuinely
37
+ non-negotiable. UIT also runs an SSL service for cases the host cannot
38
+ cover.
39
+ verify: A post-deploy request to the production URL over https succeeds.
40
+
41
+ - id: custom-domain
42
+ what: >
43
+ Serves the approved stanford.edu subdomain (or the approved
44
+ Stanford-branded .org/.com), not only a *.netlify.app or *.vercel.app URL.
45
+ policy: minweb
46
+ why: >
47
+ MinWeb scope covers Stanford-branded non-stanford.edu domains too;
48
+ sup.org is the live example. The NAME is approved by University
49
+ Communications and is not the host's decision or ours.
50
+ verify: Production URL matches the domain recorded in .sws/manifest.yml.
51
+ note: >
52
+ A vendor preview domain is fine pre-launch. press-nextjs currently
53
+ publishes to a *.vercel.app URL, which is why this is worth checking.
54
+
55
+ - id: admin-mfa
56
+ what: MFA, or SSO with MFA, on the hosting dashboard itself.
57
+ policy: minweb
58
+ why: >
59
+ "MFA on all administrative logins" is routinely read as covering only the
60
+ obvious logins. The
61
+ host dashboard can trigger a deploy and read environment variables, so it
62
+ is an administrative login. This is the most-missed item in this file.
63
+ verify: Manual attestation on the launch checklist.
64
+
65
+ - id: no-committed-secrets
66
+ what: >
67
+ Environment variables injected at build or run time, never committed.
68
+ Vault is the SWS source: netlify-plugin-vault-variables in the
69
+ storyblok-next-netlify family, node-vault in the decoupled-drupal family.
70
+ policy: minweb
71
+ why: The only irreversible harm, and the only blocking check in this system.
72
+ verify: minweb.no-secrets. Blocking.
73
+ note: >
74
+ node-vault is the host-portable option because it does not depend on a
75
+ host build plugin. Prefer it if the project might change hosts.
76
+
77
+ - id: named-admin-access
78
+ what: >
79
+ The named technical administrator can actually log in, read build logs,
80
+ and roll back, without going through a departed employee's account.
81
+ policy: [minweb, minsec]
82
+ why: >
83
+ MinSec's quarterly account and privilege review needs a human who has
84
+ access. A site whose only deploy credential belongs to a graduated
85
+ student is a real and common failure.
86
+ verify: Manual. Record the admin in .sws/manifest.yml.
87
+
88
+ - id: sunsettable
89
+ what: Site and its DNS record can both be fully removed at retirement.
90
+ policy: minweb
91
+ why: >
92
+ Secure sunset. A dangling CNAME pointing at a decommissioned host is a
93
+ subdomain-takeover risk, and it is the step everyone forgets.
94
+ verify: Manual. Ask for the sunset plan at project start, not at the end.
95
+
96
+ recommended:
97
+ # Advisory. Good engineering, not policy. Never gate on these.
98
+ - id: security-headers-default
99
+ what: >
100
+ A sensible default security header set on every response:
101
+ Strict-Transport-Security, X-Content-Type-Options: nosniff,
102
+ Referrer-Policy, Permissions-Policy denying unused features, and
103
+ frame protection.
104
+ why: >
105
+ Cheap, boring, and cannot break a page. Every recipe should ship these
106
+ switched on. See default-header-set below for the exact values.
107
+ cost: None worth naming. This is why it is a default rather than an option.
108
+
109
+ - id: csp
110
+ what: A Content-Security-Policy.
111
+ why: Defence in depth against injected script.
112
+ cost: >
113
+ REAL, AND THE REASON THIS IS NOT A DEFAULT. A CSP is the one header that
114
+ breaks pages, and it breaks them at CONTENT-EDIT time rather than at
115
+ deploy time, which is the worst possible moment. An owner embeds a
116
+ YouTube video, a Qualtrics survey, or a Google Font, the browser blocks
117
+ it silently, and nobody can work out why. See csp-guidance below.
118
+ default: OFF.
119
+
120
+ - id: preview-urls
121
+ what: A unique URL per pull request.
122
+ why: >
123
+ The real reason to move off GitHub Pages once more than one person
124
+ reviews changes. Netlify and Vercel both do this; Pages structurally
125
+ cannot.
126
+ cost: None. Do not make pull requests mandatory to get it.
127
+
128
+ - id: redirects
129
+ what: Declarative redirects and rewrites without running a server.
130
+ why: >
131
+ University IA churns constantly, and most Stanford sites replace
132
+ something. sulgryphon-nextjs is the reference: nine redirect rules
133
+ catching legacy Drupal and WordPress paths (/node/*, /wp-content/*,
134
+ *.php) and three rewrites to discover.stanford.edu.
135
+ cost: Static hosting on Pages gives you almost none of this.
136
+
137
+ - id: server-runtime
138
+ what: SSR, route handlers, image optimization, incremental revalidation.
139
+ why: Needed by next-ssr and astro-ssr. Not needed by astro-static.
140
+ cost: >
141
+ Rules out purely static hosting. Do NOT reach for a server runtime you do
142
+ not need; a static site is cheaper to run and cheaper to keep compliant.
143
+
144
+ deferred:
145
+ # OUT OF SCOPE for now, listed so the absence is not read as an oversight.
146
+ # See standards/scope.md.
147
+ - id: cms-rebuild-webhook
148
+ what: An endpoint a CMS can call to trigger a rebuild on publish.
149
+ why_deferred: >
150
+ This package is scoped to static content authored in the repo, so there is
151
+ no publish event to listen for. All three hosts support it -- build hooks
152
+ on Netlify and Vercel, repository_dispatch on Pages -- so this is a scope
153
+ decision, not a capability gap. It returns with the CMS.
154
+ note: >
155
+ This was the item that made git disappear for a non-technical owner, and
156
+ losing it has a real consequence: without a CMS, the paths are GitHub web
157
+ UI editing or a referral to Stanford Sites. That is a discovery
158
+ conversation, not a technical detail. See standards/scope.md.
159
+
160
+ # ------------------------------------------------------------------ the default
161
+ default_header_set:
162
+ note: >
163
+ Ship these ON, in every recipe, on every host. They are deliberately the
164
+ headers that cannot break a content edit. Values are the same ones
165
+ adapt-stanford-homesite serves, minus its CSP.
166
+ headers:
167
+ Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload"
168
+ X-Content-Type-Options: "nosniff"
169
+ Referrer-Policy: "origin-when-cross-origin"
170
+ Permissions-Policy: "geolocation=(), camera=(), microphone=(), midi=(), payment=(), usb=()"
171
+ X-Frame-Options: "SAMEORIGIN"
172
+ gotchas:
173
+ - >
174
+ X-Frame-Options is SAMEORIGIN, not DENY. DENY breaks a CMS Visual Editor
175
+ preview, which needs to iframe the site. The homesite uses DENY on the app
176
+ and a separate policy for its editor route. THERE IS NO CMS IN SCOPE HERE
177
+ (standards/scope.md), so that problem is absent and SAMEORIGIN is simply
178
+ the right default -- do not import the two-policy pattern to solve a
179
+ problem you do not have.
180
+ - >
181
+ Permissions-Policy denies only what a university brochure site never uses.
182
+ Do not extend the deny-list past that without checking: a lab site with an
183
+ embedded instrument feed or a map may legitimately need geolocation.
184
+ - >
185
+ Gate headers on the deployed environment if they fight local development.
186
+ The homesite returns [] when not on the host, which is worth copying.
187
+ - >
188
+ Static hosting on GitHub Pages CANNOT send these. It serves files, not
189
+ headers. That is a stated cost of astro-static, not a defect to fix.
190
+
191
+ # --------------------------------------------------------------------- CSP note
192
+ csp_guidance:
193
+ position: >
194
+ Not required, not a default, genuinely nice to have. Offer it, never
195
+ assume it, and never let it be the reason a recipe or a host looks
196
+ non-compliant.
197
+ do_not:
198
+ - >
199
+ DO NOT build a CSP from a domain allowlist. It drifts, it eventually
200
+ allows everything, and every embed a content owner adds is a support
201
+ ticket they cannot diagnose themselves.
202
+ - >
203
+ DO NOT enable CSP on a site whose owner is non-technical unless someone
204
+ has agreed to own the breakage. This is the whole reason it is off by
205
+ default.
206
+ if_you_do:
207
+ - >
208
+ Start with Content-Security-Policy-Report-Only. It cannot break a page by
209
+ construction, and it tells you what a real policy would have blocked.
210
+ - Record the choice in .sws/manifest.yml. It is a divergence from the default.
211
+ prior_art_note: >
212
+ None of the five Vercel-hosted repos sets any security headers, and
213
+ sulgryphon-nextjs's headers() sets only X-Robots-Tag for non-production.
214
+ That is PERMITTED, not a finding. Only adapt-stanford-homesite has the full
215
+ set, and exemplary is not the bar.
@@ -0,0 +1,306 @@
1
+ # Host profile: GitHub Pages
2
+ #
3
+ # reviewed: 2026-09-03
4
+ # status: in production for this project's own site. No SWS unit site uses it yet.
5
+
6
+ id: github-pages
7
+ name: GitHub Pages
8
+ pairs_with: [astro-static]
9
+ incompatible_with: [astro-ssr, next-ssr]
10
+
11
+ # ----------------------------------------------------------------- the opinion
12
+ pick_this_when: >
13
+ The site is static, the unit has no hosting account and no budget line, and
14
+ nobody needs a preview URL. It is free, it is already attached to the repo the
15
+ code lives in, and there is no vendor relationship to procure. For a
16
+ department, lab, or course site that is a dozen pages of content, this is
17
+ genuinely the right answer and the cheapest thing to keep compliant.
18
+
19
+ do_not_pick_this_when: >
20
+ You need response headers, per-PR previews, redirects, or any server runtime.
21
+ And do NOT statically export a Next site to fit here: that forfeits the entire
22
+ reason to use Next. Use astro-static instead.
23
+
24
+ # ------------------------------------------------------------------- capability
25
+ capabilities:
26
+ required:
27
+ https-live-cert: >
28
+ Yes, automatic, including on a custom domain. Enforce HTTPS in
29
+ Settings -> Pages.
30
+ custom-domain: >
31
+ Yes, via a CNAME file in the build output plus a DNS record. See the
32
+ dotfile gotcha below, which bites exactly here.
33
+ admin-mfa: >
34
+ Inherited from GitHub org SSO, so usually already satisfied. Worth
35
+ confirming rather than assuming.
36
+ no-committed-secrets: >
37
+ GitHub Actions secrets. NOTE: a static build has no runtime, so any value
38
+ reaching the browser is public whatever you call it. Do not put a secret
39
+ in a static build and expect it to stay secret.
40
+ named-admin-access: >
41
+ Repo permissions. Strong here: access is the same access the code uses,
42
+ and it survives someone leaving if the org owns the repo.
43
+ sunsettable: >
44
+ Yes. Disable Pages, remove the DNS record. Remember the DNS half.
45
+ recommended:
46
+ security-headers-default: >
47
+ NO. This is the real limitation. Pages serves files, not headers, so the
48
+ default header set in capabilities.yml cannot be sent. A <meta
49
+ http-equiv> CSP partially works, but HSTS, X-Frame-Options,
50
+ Referrer-Policy and Permissions-Policy do not exist as meta equivalents,
51
+ and frame-ancestors is ignored in meta form. Accept this or change host;
52
+ do not fake it.
53
+ csp: Partial at best, via meta. Not worth doing here.
54
+ preview-urls: >
55
+ NO, structurally. Pages serves one site per repo. A pull request gets
56
+ checks but no URL. Say so up front rather than letting someone expect it.
57
+ redirects: >
58
+ Almost none. No server, no _redirects equivalent. A 404.html and
59
+ client-side redirect shims are the whole toolkit. If the site replaces a
60
+ legacy site with inbound links, this is a strong reason to pick another
61
+ host.
62
+ cms-rebuild-webhook: >
63
+ DEFERRED, not missing. repository_dispatch and workflow_dispatch both
64
+ work, but this package has no CMS to call them. See standards/scope.md.
65
+ Worth knowing that GitHub web UI editing already covers the common case:
66
+ an editor commits Markdown to main and the site rebuilds.
67
+ server-runtime: NO. By definition.
68
+
69
+ # ---------------------------------------------------------------------- how to
70
+ deploy:
71
+ mechanism: GitHub Actions, first-party actions only.
72
+ trigger: >
73
+ Push to main deploys. Trigger on push, pull_request, and workflow_dispatch,
74
+ then gate only the deploy job. Do NOT add branch protection or required
75
+ checks: each quietly converts push-to-main into a pull-request requirement,
76
+ and campus editors working through the GitHub web UI cannot open one.
77
+ actions:
78
+ checkout: v7
79
+ setup-node: v7
80
+ configure-pages: v6
81
+ upload-pages-artifact: v5
82
+ deploy-pages: v4
83
+ note: >
84
+ Artifact actions v3 are no longer supported for Pages, and
85
+ upload-pages-artifact v4+ requires deploy-pages v4 or newer. Note that is
86
+ NOT the same as "deploy major >= artifact major": these values are what
87
+ .github/workflows/static.yml runs against a live Pages deploy, and they are
88
+ v5 + v4. Verified 2026-09-03. Check the release pages at generation time.
89
+ permissions: >
90
+ contents: read, pages: write, id-token: write, plus issues: write and
91
+ pull-requests: write if the advisory report should be visible. Omitting the
92
+ last two produces a report nobody sees, which is worse than no report.
93
+ reference: standards/recipes/astro-static/RECIPE.md, step 8
94
+
95
+ gotchas:
96
+ - >
97
+ upload-pages-artifact EXCLUDES DOTFILES. This is the one that costs an
98
+ afternoon: a CNAME file survives (no dot) but .well-known/ does not. If the
99
+ build output needs a dotfile, verify it survives or build the tar yourself.
100
+ - >
101
+ Subpath deploys need `base` set in the framework config, or internal links
102
+ work locally and 404 in production.
103
+ - >
104
+ Settings -> Pages -> Source must be set to "GitHub Actions". It lives
105
+ outside the workflow file and is easy to forget when a deploy mysteriously
106
+ serves nothing.
107
+ - >
108
+ Do not write files into the build output between the build and `sws check`.
109
+ Both a11y and perf measurements record the build's newest mtime and report
110
+ `unknown` if the build is newer.
111
+
112
+ # ------------------------------------------------------------------ provisioning
113
+ # The agent-run path. `gh` does nearly all of this, so almost nobody needs to be
114
+ # sent to a web UI. The `sws-github` skill drives these in order.
115
+ #
116
+ # VERIFIED 2026-09-03 against SU-SWS/synthetic-web-team, which is a live Pages
117
+ # deploy, unless a step says otherwise.
118
+ provisioning:
119
+ # ---------------------------------------------------------------------------
120
+ # ASSUME A BARE MACHINE. No gh, possibly no git, no package manager. The whole
121
+ # point of this block is that the agent installs what it needs rather than
122
+ # sending a new user on a scavenger hunt.
123
+ # ---------------------------------------------------------------------------
124
+ # ---------------------------------------------------------------------------
125
+ # ASSUME A BARE MACHINE. No gh, possibly no git, no package manager.
126
+ #
127
+ # WHAT to install is standards/stack/requirements.yml, and `sws preflight`
128
+ # checks it. HOW to install is the agent's business -- see the header of that
129
+ # file for why we do not keep a package-manager matrix here.
130
+ # ---------------------------------------------------------------------------
131
+ prerequisite:
132
+ run: |
133
+ npx sws preflight # then install what it names, then run it again
134
+ needs: >
135
+ git and the gh CLI. Both appear in requirements.yml with their detection
136
+ commands; gh is conditional on hosting.provider == github-pages.
137
+
138
+ the_decision: >
139
+ INSTALL git AND gh. Not the MCP server, except as a supplement for an
140
+ agent with no shell. The obvious counter-argument -- that an MCP server
141
+ needs no install -- is a good one that is wrong for this task, so the
142
+ reasoning is recorded rather than asserted.
143
+ why_not_mcp: >
144
+ GIT IS MANDATORY EITHER WAY, and that settles it. This task pushes a
145
+ working tree: git init, a commit, a remote, a push. The GitHub REST API
146
+ can create a repo, write individual files, and switch Pages on, but it
147
+ cannot init a repo, make a local commit, add a remote, or push a tree. So
148
+ an MCP server cannot finish the job, and "no install" was never really on
149
+ offer. Once git is going in, gh is one more binary and it buys a lot.
150
+ what_gh_buys:
151
+ - >
152
+ OAuth device flow, so there is NO RAW TOKEN for the agent to mishandle.
153
+ gh stores it in the OS keychain. Committed credentials are the only
154
+ blocking finding in this system, so an auth path that never puts a
155
+ secret in a shell command or a file is worth real money.
156
+ - >
157
+ It configures the git remote AND the git credential helper in the same
158
+ step, so the push just works. With a PAT you wire that up yourself.
159
+ - "`gh api` gives the full REST surface, which is how Pages gets enabled."
160
+ - "`gh run watch` follows the deploy, so verification is one command."
161
+ - One auth system instead of two.
162
+ when_mcp_is_right: >
163
+ An agent with NO SHELL. Add the hosted server, which needs no binary:
164
+ `claude mcp add --transport http github https://api.githubcopilot.com/mcp/`
165
+ then authorise in the browser. Be aware such an agent also cannot run git,
166
+ so it can do the GitHub half and not the local half -- someone has to
167
+ supply the commits. Do not install gh AND the MCP server for the same job;
168
+ that is two auth systems for one task. NOT VERIFIED here.
169
+ version_floor: >
170
+ Anything current. Every command in `steps` below was confirmed working on
171
+ gh 2.21, which is from early 2023, so an old gh is not a reason to stop
172
+ and upgrade. Latest at the time of writing was 2.100.0.
173
+
174
+ fallback_no_install_possible: >
175
+ A locked-down machine where nothing can be installed but git already
176
+ exists. This project already requires Node (>=22.12.0), and Node 18+ has
177
+ a global `fetch`, so the REST calls in `steps` can be made from a few
178
+ lines of Node with NO new dependency. Auth then needs a Personal Access
179
+ Token -- see token_handling.
180
+
181
+ token_handling: >
182
+ ONLY when the OAuth device flow is not possible. A PAT is a credential and
183
+ this project's one blocking rule is about credentials, so handle it like
184
+ one:
185
+ - Pipe it in on STDIN: `gh auth login --with-token < token.txt`, then
186
+ delete the file. Never pass it as a command argument and never put it
187
+ in an env var inline, because both land in shell history and the
188
+ process list.
189
+ - Scopes: gh documents `repo` and `read:org` as the minimum. FOR THIS
190
+ TASK YOU ALSO NEED `workflow`, because pushing a .github/workflows
191
+ file with a token that lacks it fails with "refusing to allow a
192
+ Personal Access Token to create or update workflow". That error names
193
+ the token, not the scope, and it is a classic hour lost. `gh auth
194
+ refresh -s workflow` adds it to an existing gh session.
195
+ - Never commit it. `npx sws check` reads minweb.no-secrets and that is
196
+ the only finding in this system that blocks.
197
+
198
+ steps:
199
+ - id: auth
200
+ what: Authenticate, without sending anyone to a web form to sign up.
201
+ run: |
202
+ gh auth status || gh auth login --web --git-protocol ssh
203
+ note: >
204
+ `--web` prints a one-time code and opens the device flow, so the person
205
+ confirms in a browser they are already signed into and comes straight
206
+ back. `gh auth status` first means a re-run is a no-op.
207
+ honest_limit: >
208
+ CREATING a GitHub account cannot be done from the CLI or the API. There
209
+ is no signup endpoint, by design. If they have no account at all, that
210
+ one step is github.com/signup in a browser, and then `gh auth login`
211
+ takes over. Do not pretend otherwise, and do not ask for their password.
212
+
213
+ - id: choose-owner
214
+ what: Decide which org owns the repo. Ask; do not assume.
215
+ run: |
216
+ gh api user/orgs --jq '.[].login'
217
+ note: >
218
+ PREFER AN ORG, NOT A PERSONAL ACCOUNT. A site whose only deploy access
219
+ belongs to one person breaks the named-admin-access requirement above the
220
+ day that person graduates or leaves, and it is the most common quiet
221
+ failure in this whole file. If they have no org access, that is an
222
+ escalation, not something to work around -- see escalation.md.
223
+
224
+ - id: prep-workspace
225
+ what: git, on main, with a first commit. Idempotent.
226
+ run: |
227
+ git rev-parse --git-dir >/dev/null 2>&1 || git init
228
+ git symbolic-ref HEAD refs/heads/main
229
+ git add -A && git commit -m "Initial commit" || true
230
+ note: >
231
+ `git symbolic-ref` sets the branch without needing a commit to exist
232
+ first, so it works on an empty repo and is safe to re-run. Never rename
233
+ a default branch that already has history and a remote.
234
+ verified: >
235
+ Executed 2026-09-03 in a scratch directory. First run produced branch
236
+ `main` with one commit; a second run was a clean no-op, still one commit.
237
+ Tested outside the repo deliberately -- never prove a git sequence works
238
+ by running it against tracked source.
239
+ before_you_commit: >
240
+ Run `npx sws check` and look at minweb.no-secrets FIRST. Committed
241
+ credentials are the only blocking finding in this system, and the reason
242
+ is that pushing is the irreversible step. Rotate before you push, not
243
+ after.
244
+
245
+ - id: create-and-push
246
+ what: Create the remote and push in one call.
247
+ run: |
248
+ gh repo create <owner>/<name> --public --source=. --remote=origin --push
249
+ note: >
250
+ `--public` for a public site's source is normal and is what the SWS
251
+ repos do. Use `--private` if the unit asks; Pages still works on private
252
+ repos for org plans, and the site is public either way.
253
+
254
+ - id: enable-pages
255
+ what: >
256
+ Set Settings -> Pages -> Source to GitHub Actions, from the API. THIS IS
257
+ THE STEP EVERYONE FORGETS, including this project on its own first run.
258
+ run: |
259
+ gh api -X POST repos/<owner>/<name>/pages -f build_type=workflow || gh api -X PUT repos/<owner>/<name>/pages -f build_type=workflow
260
+ verified: >
261
+ The `build_type: workflow` field is confirmed real: reading
262
+ repos/SU-SWS/synthetic-web-team/pages returns it. POST creates and PUT
263
+ updates, so a 409 on POST means Pages is already on and the PUT handles
264
+ it. The POST itself is not exercised in this repo -- confirm on first run.
265
+ why_it_matters: >
266
+ Until this is set, the github-pages environment keeps its default
267
+ deployment-branch protection and the deploy job fails with "Branch main
268
+ is not allowed to deploy to github-pages due to environment protection
269
+ rules." That error names protection rules, so people go and fight the
270
+ environment settings instead of switching the source.
271
+
272
+ - id: workflow
273
+ what: Add the Pages workflow.
274
+ source: standards/recipes/astro-static/RECIPE.md, step 8
275
+ note: >
276
+ Do not hand-write it. The recipe has the shape, the permissions block,
277
+ and the concurrency group. Two things to carry over deliberately: it
278
+ triggers on push, pull_request and workflow_dispatch but GATES ONLY THE
279
+ DEPLOY JOB, and it sets no branch protection.
280
+
281
+ - id: verify
282
+ what: Confirm the deploy, and check two MinWeb items while you are here.
283
+ run: |
284
+ gh run watch
285
+ gh api repos/<owner>/<name>/pages --jq '{url: .html_url, https: .https_enforced, cname: .cname}'
286
+ note: >
287
+ `https_enforced: true` is the MinWeb HTTPS requirement, verifiable rather
288
+ than attested. `cname: null` means no custom domain yet, so the site is
289
+ still on a github.io URL -- fine pre-launch, not fine at launch. The
290
+ subdomain NAME is University Communications' decision.
291
+
292
+ what_this_does_not_do:
293
+ # Say these out loud at the end. Provisioning is not launching.
294
+ - Approve the stanford.edu subdomain. University Communications, with a lead time.
295
+ - Request the ODA accessibility review. Pre-launch gate, needs lead time.
296
+ - Register with Siteimprove. Required for public sites, its own intake.
297
+ - >
298
+ Attest MFA on the GitHub account and on any org owner account. That is an
299
+ administrative login under MinWeb.
300
+ - Name the business owner and technical administrator in .sws/manifest.yml.
301
+
302
+ procurement: >
303
+ Nothing to procure. Already covered by the university's GitHub relationship,
304
+ which is the quiet reason this is the lowest-friction option. Getting a person
305
+ ADDED to a Stanford GitHub org is an access request, not a purchase, and it
306
+ needs an org owner -- see standards/policy/escalation.md.