@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,131 @@
1
+ ---
2
+ name: sws-diverge
3
+ description: Leave the preferred Stanford Web Services stack deliberately and correctly. Use when the user wants a different framework, CMS, host, or library than the recipe specifies, when they push back on a standard, or when a recipe's default does not fit their situation.
4
+ ---
5
+
6
+ # Diverging on purpose
7
+
8
+ The standards are defaults, not a cage. Deviating is supported and expected.
9
+ Your job is to make divergence a **documented decision** rather than either a
10
+ refusal or a silent drift.
11
+
12
+ Three failure modes to avoid, in order of how annoying they are:
13
+
14
+ 1. **Refusing.** "The standard says Astro" is not an answer. The person has
15
+ context you do not.
16
+ 2. **Silently abandoning the standards.** Switching framework and quietly
17
+ dropping the footer check, the a11y target, and the ownership requirement
18
+ along with it.
19
+ 3. **Relitigating.** Re-raising a divergence that is already recorded in the
20
+ manifest, every session.
21
+
22
+ ## What to do
23
+
24
+ **1. Find the swap point.** Every recipe has a table of supported deviations
25
+ with the cost of each. Read it and quote the cost plainly. If the swap is listed,
26
+ this is a two-minute conversation, not a negotiation.
27
+
28
+ **2. Separate what changes from what does not.** This is the important part.
29
+ Most divergences change the *implementation* and change nothing about the
30
+ *obligations*. Moving from GitHub Pages to Netlify does not alter the HTTPS
31
+ requirement, the footer, the accessibility target, the named owners, or
32
+ Siteimprove registration. Say which obligations survive, explicitly, because
33
+ that is exactly what gets lost.
34
+
35
+ **3. Name what stops being automatic.** Some divergences move a requirement from
36
+ "handled by the recipe" to "yours to satisfy." Dropping Decanter means the
37
+ Identity Bar and Global Footer become hand-maintained while every brand and a11y
38
+ check still applies, with nothing helping you pass them. That is usually the
39
+ decisive fact.
40
+
41
+ **4. Record it.** In `.sws/manifest.yml`:
42
+
43
+ ```yaml
44
+ divergences:
45
+ - from: astro-static
46
+ changed: Next.js instead of Astro
47
+ reason: Team maintains three other Next apps and shares components
48
+ cost_accepted: >
49
+ Static export forfeits redirects, headers, and image optimization
50
+ date: 2026-08-11
51
+ by: sheamck@stanford.edu
52
+ ```
53
+
54
+ The record is what lets the next person understand the project, and it is what
55
+ stops `sws doctor` nagging about a choice already made deliberately.
56
+
57
+ **5. Say when a swap is genuinely unsupported.** Not everything is a preference.
58
+ Tailwind 3 with Decanter 8 does not work, because Decanter 8 requires Tailwind 4.
59
+ That is a fact, not a standard, and the honest answer is that the combination
60
+ will not build.
61
+
62
+ ## Divergences that are not divergences
63
+
64
+ Do not record these, and do not treat them as departures:
65
+
66
+ - **Using yarn instead of npm.** Both are in production use at SWS. Respect what
67
+ the project has and never convert it.
68
+ - **Cypress instead of Playwright** on a project that already has Cypress.
69
+ Playwright is the forward default for new work, not a migration mandate.
70
+ - **`clsx` plus `tailwind-merge` instead of `cnbuilder`.** Both are house
71
+ conventions, split by project family.
72
+ - **Installing Decanter from the git v8 branch.** Two SWS projects do; it is
73
+ valid.
74
+ - **Copy-forking a previous client site to start a new one.** This is how SWS
75
+ works and it works. `csp-nextjs` was made from `cardinalsites-nextjs`
76
+ deliberately. Add a way to see what has changed since; do not frame the fork
77
+ as a mistake.
78
+
79
+ ## Requests that are out of scope rather than divergent
80
+
81
+ **A CMS is the live example.** `standards/scope.md` scopes this package to
82
+ static content authored in the repo, and it has no tested CMS path — not
83
+ Storyblok, not decoupled Drupal.
84
+
85
+ That is **not a divergence you can record and move on from.** A divergence is
86
+ choosing something different to build the same thing with; this is asking for a
87
+ capability the package does not ship. Recording `divergences: [storyblok]` in
88
+ the manifest would imply a supported swap point exists, and it does not.
89
+
90
+ So handle it differently:
91
+
92
+ - **Say plainly that it is not covered yet.** Eleven SWS repos are CMS-backed in
93
+ production, so the capability exists in the org. There is just no tested
94
+ recipe here, and saying so beats shipping guidance nobody has run.
95
+ - **Ask what they actually need.** Often it is "a non-developer must edit the
96
+ copy," which GitHub web UI editing already handles for one or two people.
97
+ - **If they need a real CMS**, that is a legitimate project. Point them at
98
+ Stanford Sites if they will maintain the site alone, or raise it as scope for
99
+ a `*-storyblok` overlay. Do not build half a content backend to avoid the
100
+ conversation.
101
+ - **Out of scope is not forbidden.** Do not tell anyone they cannot have a CMS,
102
+ and do not imply the existing SWS CMS work is wrong.
103
+
104
+ ## Divergences that change the compliance tier
105
+
106
+ Different category, and these are not yours to wave through. If a divergence
107
+ introduces personal data collection, authentication, or payments, the site moves
108
+ from `low` to `moderate` or `high` risk. New obligations attach: Duo, centralised
109
+ logging, secure SDLC, backups, possibly a Data Risk Assessment before deploy.
110
+
111
+ Flag it as a tier change rather than a feature, name the obligations, and point
112
+ at the right office per `standards/policy/escalation.md`. You are not the
113
+ approver.
114
+
115
+ ## What never bends
116
+
117
+ Divergence does not reach these, because they are policy rather than preference:
118
+
119
+ - WCAG 2.1 AA as the target
120
+ - The Global Footer contract and the Identity Bar
121
+ - Named business owner and technical administrator
122
+ - HTTPS with a live certificate
123
+ - No committed credentials
124
+ - Siteimprove registration for public-facing sites
125
+ - Subdomain naming approved by University Communications
126
+
127
+ A person can still choose not to satisfy one of these. That is what
128
+ `.sws/acknowledged.yml` is for: a dated, attributed, reasoned risk acceptance
129
+ with a review date, which is the same shape a MinSec temporary exception takes.
130
+ It is a supported action. It is not the same as the requirement going away, and
131
+ the report keeps showing it under accepted risks.
@@ -0,0 +1,171 @@
1
+ ---
2
+ name: sws-github
3
+ description: Put a Stanford site on GitHub and deploy it to GitHub Pages, driven from the terminal. Use when a project needs a git repo, a GitHub remote, an org to own it, or a Pages deployment; when someone asks how to publish or where the code should live; or when they have no GitHub account yet.
4
+ ---
5
+
6
+ # Get it on GitHub, and deployed
7
+
8
+ **Do the work for them, starting from nothing.** Assume a new machine with
9
+ nothing installed. Once `git` and `gh` are in place, `gh` authenticates, creates
10
+ the repo, pushes, and turns Pages on, so almost nobody needs a web UI — do not
11
+ send them to one out of habit. The exact commands, and what is verified versus
12
+ not, are in `standards/hosting/github-pages.yml` under `provisioning`. Read
13
+ that; this file is the order, the questions, and the judgment.
14
+
15
+ ## First, ask three questions
16
+
17
+ Ask them together, before running anything. The answers change the work.
18
+
19
+ 1. **"Do you have a GitHub account?"** If yes, `gh auth login` is the whole
20
+ story once `gh` is installed. If no, see below — account creation is the one
21
+ step that genuinely needs a browser.
22
+ 2. **"Which Stanford org should own this?"** Run `gh api user/orgs --jq '.[].login'`
23
+ and show them what they already belong to. Do not guess.
24
+ 3. **"What should the repo be called?"** Their call, not yours. Suggest the unit
25
+ or site name; a repo name is not the subdomain and does not need approval.
26
+
27
+ **Prefer an org over a personal account, and say why.** A site whose only deploy
28
+ access belongs to one person breaks MinWeb's named-administrator requirement the
29
+ day that person graduates. This is the most common quiet failure in the whole
30
+ hosting story. If they have no org access, that is an access request needing an
31
+ org owner, not something to work around — route per
32
+ `standards/policy/escalation.md` and be honest that the GitHub route is not yet
33
+ a confirmed door.
34
+
35
+ ## Preflight: assume the machine is bare
36
+
37
+ **Assume nothing is installed.** No `gh`, possibly no `git`, possibly no package
38
+ manager. Use the `sws-preflight` skill, or just:
39
+
40
+ ```bash
41
+ npx sws preflight # then install what it names, then run it again
42
+ ```
43
+
44
+ It reports what is missing and why it matters, and deliberately does not say how
45
+ to install it — that is yours, because you know the platform. **Re-run it after
46
+ installing.** An installer that exited 0 without putting the binary on `PATH` is
47
+ the common failure, and it hides until something else breaks.
48
+
49
+ **Install `git` and `gh`. Not the MCP server** — and the reason matters, because
50
+ "an MCP server needs no install" is a fair argument that happens to be wrong
51
+ here. **You are installing `git` either way.** This task pushes a working tree:
52
+ `init`, commit, remote, push. The GitHub API can create a repo, write files, and
53
+ switch Pages on, but it cannot init a repo, commit locally, or push a tree. So
54
+ an MCP server cannot finish the job and the install was never avoidable. Once
55
+ `git` is going in, `gh` is one more binary that buys the OAuth device flow (no
56
+ raw token to mishandle, stored in the OS keychain), the git remote and
57
+ credential helper wired up in the same step, `gh api` for enabling Pages, and
58
+ `gh run watch` for verification.
59
+
60
+ Use the hosted MCP server only for an agent with **no shell at all**
61
+ (`claude mcp add --transport http github https://api.githubcopilot.com/mcp/`).
62
+ Note such an agent cannot run `git` either, so it can do the GitHub half and not
63
+ the local half. Never install both for one job — that is two auth systems.
64
+
65
+ **On macOS, `git --version` can itself trigger the Xcode Command Line Tools
66
+ dialog.** A person has to click that; an agent cannot. Say it is about to happen
67
+ rather than letting a box appear from nowhere.
68
+
69
+ ### If they have no account
70
+
71
+ Say plainly: **creating a GitHub account cannot be done from a CLI or an API.**
72
+ There is no signup endpoint, by design. That single step is `github.com/signup`
73
+ in a browser, then `gh auth login --web` takes over and you drive the rest. Do
74
+ not pretend to automate it, and never ask for their password.
75
+
76
+ ### If nothing can be installed
77
+
78
+ On a locked-down machine that has `git` but cannot add `gh`: this project already
79
+ requires **Node** (`>=22.12.0`), and Node 18+ has a global `fetch`, so every
80
+ REST call in the runbook can be made from a few lines of Node with **no new
81
+ dependency**. Auth then needs a Personal Access Token, which is a credential —
82
+ pipe it in on stdin (`gh auth login --with-token < token.txt`, then delete the
83
+ file), never as a command argument or inline env var, because both land in shell
84
+ history and the process list.
85
+
86
+ **That token needs the `workflow` scope**, on top of the documented `repo` and
87
+ `read:org`. Pushing a `.github/workflows` file without it fails with *"refusing
88
+ to allow a Personal Access Token to create or update workflow"* — an error that
89
+ names the token rather than the missing scope, and costs an hour.
90
+ `gh auth refresh -s workflow` adds it.
91
+
92
+ While they are there: **turn on 2FA.** GitHub is an administrative login that can
93
+ trigger a deploy and read secrets, so MinWeb's "MFA on all administrative
94
+ logins" covers it. GitHub requires 2FA for contributors anyway.
95
+
96
+ ## Then run the steps in order
97
+
98
+ Follow `provisioning.steps` in `standards/hosting/github-pages.yml`: `auth`,
99
+ `choose-owner`, `prep-workspace`, `create-and-push`, `enable-pages`, `workflow`,
100
+ `verify`. They are written to be idempotent, so a re-run is safe.
101
+
102
+ Three that deserve attention:
103
+
104
+ **Before the first commit, check for secrets.** Run `npx sws check` and look at
105
+ `minweb.no-secrets`. This is the only blocking finding in the system, and the
106
+ reason is that **pushing is the irreversible step**. If something is already
107
+ committed locally, rotate the credential first, then clean history, then push.
108
+ Blocking the deploy does not un-leak anything.
109
+
110
+ **`enable-pages` is the step everyone forgets**, including this project on its
111
+ own first run. Until Pages source is set to GitHub Actions, the deploy fails
112
+ with *"Branch main is not allowed to deploy to github-pages due to environment
113
+ protection rules."* That message points at protection rules, so people go and
114
+ fight the environment settings instead of switching the source. Set it from the
115
+ API and skip the whole detour.
116
+
117
+ **Never add branch protection or required status checks.** Push to `main`
118
+ deploys. Many campus editors work through the GitHub web UI, which is
119
+ push-to-main by construction, and they will not open a pull request to fix a
120
+ typo. Pull requests are first-class and never required. If a repo already has
121
+ protection, leave it — someone may have chosen it. Report, do not remove.
122
+
123
+ ## The workflow
124
+
125
+ Take it from `standards/recipes/astro-static/RECIPE.md`, step 8. Do not
126
+ hand-write it. What matters:
127
+
128
+ - **Trigger on push, `pull_request`, and `workflow_dispatch`; gate only the
129
+ deploy job.** A workflow that deploys only on merge locks out web-UI editors.
130
+ - **The permissions block needs `issues: write` and `pull-requests: write`** on
131
+ top of the Pages ones. Drop them and the advisory report is generated and
132
+ nobody ever sees it, which is worse than not running it.
133
+ - **`concurrency: {group: pages, cancel-in-progress: false}`.** Queue, do not
134
+ skip, per GitHub's own Pages guidance.
135
+ - **Pages serves one site, so a pull request gets checks but no preview URL.**
136
+ Say so, rather than letting someone expect previews. Wanting previews is a
137
+ good reason to look at Netlify or Vercel — see `standards/hosting/`.
138
+
139
+ Two traps worth an afternoon each:
140
+
141
+ 1. **`upload-pages-artifact` excludes dotfiles.** `CNAME` survives; `.well-known/`
142
+ does not. Verify anything dot-prefixed reaches `dist`.
143
+ 2. **A subpath deploy needs `base`** set in the framework config, or links work
144
+ locally and break in production. `su-sws.github.io/<repo>/` is a subpath.
145
+
146
+ ## Verify, then say what you have not done
147
+
148
+ ```bash
149
+ gh run watch
150
+ gh api repos/<owner>/<repo>/pages --jq '{url: .html_url, https: .https_enforced, cname: .cname}'
151
+ ```
152
+
153
+ `https_enforced: true` satisfies MinWeb's HTTPS requirement and is verifiable
154
+ rather than attested, which is rare and worth using. `cname: null` means the site
155
+ is still on a `github.io` URL — fine now, not at launch.
156
+
157
+ **Provisioning is not launching.** Close by naming what remains, because these
158
+ have lead times and none of them is yours to grant:
159
+
160
+ - **The `stanford.edu` subdomain** — University Communications approves the name.
161
+ - **The ODA accessibility review** — a pre-launch gate; raise it now, not the
162
+ week before.
163
+ - **Siteimprove registration** — required for public sites, its own intake.
164
+ Google Analytics is *not* required.
165
+ - **Business owner and technical administrator** in `.sws/manifest.yml`, both
166
+ with valid Stanford affiliation.
167
+ - **MFA attested** on the account and on any org owner account.
168
+
169
+ Record what you did in `.sws/manifest.yml` under `hosting`: `provider:
170
+ github-pages`, the `production_url`, and the date MFA was confirmed. The next
171
+ person should not have to guess where the site lives.
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: sws-install
3
+ description: Install the Stanford Web Services standards into a specific project, once the skills are already installed in this tool. Use when someone wants to start a Stanford site in a repository, add the standards to an existing project, or asks why AGENTS.md and .sws are missing even though the sws-* skills are available.
4
+ ---
5
+
6
+ # Install into a project
7
+
8
+ The install has two halves, and you are reading this because the first one is
9
+ done. The skills came from a **user-level install** into the person's tool, so
10
+ they are available in every project on this machine. Nothing per-site is
11
+ installed yet.
12
+
13
+ This skill does the second half: the per-project record.
14
+
15
+ ```bash
16
+ npx @su-sws/synthetic-web-team init # a new site, in an empty directory
17
+ npx @su-sws/synthetic-web-team add . # a project that already exists
18
+ ```
19
+
20
+ Run it in the repository root. **Pick deliberately:** `init` hands back a recipe
21
+ to follow afterwards, `add` assumes there is already a site and leaves the source
22
+ alone. There is no default — running with no command prints help and writes
23
+ nothing, so a wrong guess cannot put 46 files in the wrong directory.
24
+
25
+ Every flag is optional. With a terminal attached each one interviews the person;
26
+ without one it runs to completion and reports.
27
+
28
+ ## Why two halves
29
+
30
+ Skills are identical in every repository, so copying them into each one is noise
31
+ that then has to be kept in sync. The per-site record is the opposite: named
32
+ business owner, named technical administrator, the compliance tier derived from
33
+ what *this* site handles, hosting provider, recorded divergences, accepted risks
34
+ with review dates. None of that is a property of a person or a machine.
35
+
36
+ So: knowledge installs once per tool, the record installs once per site.
37
+
38
+ ## What the project install writes
39
+
40
+ | Path | What |
41
+ |---|---|
42
+ | `AGENTS.md` | The behavioral contract. Repo-rooted on purpose, so a reviewer and CI can both see it |
43
+ | `standards/` | Vendored, because skills reference them by relative path and CI has no home directory to read |
44
+ | `.sws/manifest.yml` | What this project is and what was decided. **Never overwritten** on a re-run |
45
+ | `.sws/acknowledged.yml` | Accepted risks, with reasons and review dates. Never overwritten |
46
+ | `.sws/installed.json` | Hashes of what was written, so an update can tell a local edit from an old version. Commit it |
47
+ | Editor pointers | `CLAUDE.md`, `.cursor/rules/sws.mdc`, and similar. Thin pointers to `AGENTS.md`, never content copies |
48
+
49
+ **No skills.** If you find `.agents/skills/` or `.claude/skills/` inside a
50
+ project, it predates the two-part install. That is not a fault and nothing
51
+ breaks, but the copies there are frozen and the user-level ones are what update.
52
+
53
+ ## What to do with the result
54
+
55
+ Read the JSON, not the prose. Four fields matter:
56
+
57
+ - **`next[]`** — what to do next, as data. Each step names a path or command and
58
+ a reason. Work through it in order.
59
+ - **`incomplete[]`** — manifest fields still holding placeholders. **Ask the
60
+ person.** MinWeb requires a named business owner and technical administrator
61
+ with real Stanford email addresses, so never invent one.
62
+ - **`counts`** — tells a fresh install from a no-op re-run.
63
+ - **`dependency`** — whether `@su-sws/synthetic-web-team` reached the project's
64
+ `devDependencies`. It has to, because unscoped `sws` on the public registry is
65
+ an unrelated package and `npx sws` would otherwise run that instead of this
66
+ CLI. Run `npm install` before verifying.
67
+
68
+ Then verify:
69
+
70
+ ```bash
71
+ npx sws doctor --format json
72
+ ```
73
+
74
+ ## Re-running is the update
75
+
76
+ There is no separate update command. Content is rewritten from source, `.sws`
77
+ state is preserved, and a file the person edited is reported as a conflict and
78
+ left alone — on every run, not just the first. Pass `--force` only if they have
79
+ said they want their edits discarded.
80
+
81
+ If `sws doctor` says the project's standards version is behind the version this
82
+ tool carries, that is drift between the user-level install and what this project
83
+ recorded. It is a note, not a compliance finding: being behind is a maintenance
84
+ fact about the toolchain, not a fact about whether the site meets Stanford's
85
+ requirements.
86
+
87
+ ## If the skills are missing on a new machine
88
+
89
+ The user-level half:
90
+
91
+ ```bash
92
+ npx @su-sws/synthetic-web-team install
93
+ ```
94
+
95
+ Writes the skills into `~/.claude/skills/` and `~/.agents/skills/` and nothing
96
+ else. Removable with `install --remove`, which deletes only what its own install
97
+ record lists, so unrelated skills in those directories are never touched.
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: sws-netlify
3
+ description: Move a Stanford site from GitHub Pages to Netlify, or provision it there from the start, driven from the terminal where possible. Use when a project needs per-PR previews, response headers, real redirects, or a server runtime, and the unit has or wants a Netlify account.
4
+ ---
5
+
6
+ # Get it onto Netlify
7
+
8
+ **This is a different shape of job from `sws-github`, and the difference is the
9
+ thing to get right.** `gh` can do the entire GitHub-side job headlessly: a PAT
10
+ or an OAuth grant is enough to create a repo, push, and flip on Pages. Netlify's
11
+ git-based continuous deployment instead needs the Netlify account to hold a
12
+ GitHub App authorization scoped to the repo, and granting that is an OAuth
13
+ consent screen in a browser — there is no API call that substitutes for it.
14
+ Say this up front rather than promising a fully scripted path and then hitting
15
+ a browser prompt partway through.
16
+
17
+ The exact commands, and what is verified versus reasoned, are in
18
+ `standards/hosting/netlify.yml` under `provisioning`. Read that; this file is
19
+ the order, the questions, and the judgment.
20
+
21
+ ## First, ask
22
+
23
+ 1. **"Do you already have a Netlify account, and is it a team or personal?"**
24
+ Prefer a team. A site whose only deploy access belongs to one person breaks
25
+ MinWeb's named-administrator requirement the day that person leaves — the
26
+ same failure as a personal GitHub account in `sws-github`. If they have no
27
+ team access, that is an access request for a team owner, not something to
28
+ work around — route per `standards/policy/escalation.md`.
29
+ 2. **"Does the repo already exist on GitHub?"** Netlify connects to a repo, it
30
+ does not create one. If there is no repo yet, run `sws-github` first, or at
31
+ least get the code pushed, before starting here.
32
+ 3. **"Why Netlify and not Vercel?"** Read `standards/hosting/netlify.yml` and
33
+ `standards/hosting/vercel.yml` together before answering for them. The right
34
+ answer is almost always "the unit already administers one of these two" —
35
+ ask rather than picking on shared-tooling grounds alone.
36
+
37
+ ## Preflight
38
+
39
+ ```bash
40
+ npx sws preflight # then install what it names, then run it again
41
+ ```
42
+
43
+ **The Netlify CLI is optional here**, unlike `gh` for GitHub Pages —
44
+ `standards/stack/requirements.yml` marks it `optional: true` because Netlify
45
+ deploys from its git integration, not from the CLI. Install it anyway for local
46
+ dev, environment variables, and verification; just do not treat its absence as
47
+ a blocker the way a missing `gh` is one.
48
+
49
+ `git` is still mandatory regardless of host, for the same reason as always: a
50
+ working tree has to exist and be pushed before any host can deploy it.
51
+
52
+ ## Then run the steps in order
53
+
54
+ Follow `provisioning.steps` in `standards/hosting/netlify.yml`: `auth`,
55
+ `choose-team`, `create-and-connect`, `build-config`, `verify`.
56
+
57
+ **`create-and-connect` is the step that opens a browser**, and it is the one
58
+ honest limit in this whole skill. `netlify init`, run from inside the repo,
59
+ walks a new-or-existing-site choice, a team choice, and — the part that cannot
60
+ be scripted around — the GitHub App authorization, if the team has not already
61
+ granted it for this repo. Tell the person this is coming before running it,
62
+ the same way `sws-github` warns about the macOS Xcode Command Line Tools dialog
63
+ appearing unannounced. Once a team's GitHub App grant covers new repos in that
64
+ org, later projects on the same team skip the consent screen entirely.
65
+
66
+ **Config belongs in the repo, not the dashboard.** Commit `netlify.toml` for
67
+ build command, publish directory, and headers per
68
+ `standards/recipes/astro-ssr/RECIPE.md` step 8b, for the same reason secrets go
69
+ in Vault rather than a host UI: it survives a dashboard reorganisation and a
70
+ person leaving. Reserve `netlify env:set` for values that must not be
71
+ committed, and prefer `netlify-plugin-vault-variables` — the ADAPT/OOD family
72
+ convention — over hand-set dashboard values.
73
+
74
+ **Secrets do not live in `.env` in production.** If the unit's Vault access is
75
+ not yet set up, that is its own request to the Vault administrator, not
76
+ something this skill can provision.
77
+
78
+ ## Never add branch protection or required status checks
79
+
80
+ Same rule as `sws-github`, for the same reason: many campus editors work through
81
+ the GitHub web UI, which is push-to-main by construction, and branch protection
82
+ quietly turns that into a pull-request requirement. Netlify's git integration
83
+ already deploys on push to `main`; keep any GitHub Actions workflow for checks
84
+ only, never as a deploy gate.
85
+
86
+ ## Verify, then say what you have not done
87
+
88
+ ```bash
89
+ netlify open
90
+ netlify api getSite --data '{"site_id": "<site-id>"}'
91
+ ```
92
+
93
+ Unlike the GitHub Pages check, there is no single boolean here confirmed
94
+ against a live response — Netlify's automatic HTTPS is close to unconditional
95
+ for a Netlify-managed or correctly CNAMEd domain, but confirm the certificate
96
+ is actually live on first real use rather than assuming it.
97
+
98
+ **Provisioning is not launching.** Close by naming what remains, same list as
99
+ `sws-github` and with the same lead times:
100
+
101
+ - **The `stanford.edu` subdomain** — University Communications approves the name.
102
+ - **The ODA accessibility review** — a pre-launch gate; raise it now.
103
+ - **Siteimprove registration** — required for public sites, its own intake.
104
+ - **Business owner and technical administrator** in `.sws/manifest.yml`, both
105
+ with valid Stanford affiliation.
106
+ - **MFA attested** on the Netlify team dashboard — an administrative login
107
+ under MinWeb, and not on by default.
108
+
109
+ Record what you did in `.sws/manifest.yml` under `hosting`: `provider:
110
+ netlify`, the `production_url`, and the date MFA was confirmed.
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: sws-onboard
3
+ description: Orient yourself on a Stanford Web Services project before doing anything else. Use at the start of a session on an SWS project, when you find a .sws directory, or when you need to know what stack, compliance tier, and decisions a project already has.
4
+ ---
5
+
6
+ # Orient before acting
7
+
8
+ Read `.sws/manifest.yml` first. It tells you what this project is, what was
9
+ already decided, and what you must not undo.
10
+
11
+ ## What the manifest holds
12
+
13
+ ```yaml
14
+ standards_version: which version of the SWS standards generated this
15
+ recipe: which recipe was followed, e.g. astro-static
16
+ tier: low | moderate | high compliance tier
17
+ editors: which AI tools the wizard emitted config for
18
+ resolved: what versions actually installed, recorded not enforced
19
+ owners:
20
+ business: name and Stanford email
21
+ technical: name and Stanford email
22
+ siteimprove: registration recorded, or absent
23
+ prior_art: what was reused, and from where
24
+ divergences: deliberate departures from the recipe, with reasons
25
+ ```
26
+
27
+ If there is no `.sws/` directory, this is not an SWS-managed project. Offer to
28
+ add the standards rather than assuming them, and do not restructure anything
29
+ without being asked.
30
+
31
+ ## Then read, in this order
32
+
33
+ 1. **`AGENTS.md`** at the repo root. The behavioral contract. Non-negotiables
34
+ are there.
35
+ 2. **`divergences`** in the manifest. Somebody already decided to leave the
36
+ preferred path. Do not "fix" a recorded divergence back to the default; that
37
+ is undoing a decision.
38
+ 3. **`.sws/acknowledged.yml`**. Accepted risks with reasons and review dates. Do
39
+ not re-raise an acknowledged finding as if it were new. If a `review_by` date
40
+ has passed, that is worth mentioning once, kindly.
41
+ 4. **The recipe** named in the manifest, at `standards/recipes/<id>/RECIPE.md`,
42
+ plus its `acceptance.yml`, which is the definition of correct for this
43
+ project.
44
+
45
+ ## Tier changes the obligations
46
+
47
+ `tier` is derived from what the site handles, not from what the user knows about
48
+ MinSec. If the work you are about to do would change the tier, say so before
49
+ doing it, because the tier drives real requirements.
50
+
51
+ | Tier | Triggered by |
52
+ |---|---|
53
+ | `low` | Public information only |
54
+ | `moderate` | Personal data, authenticated users |
55
+ | `high` | Regulated data, payments |
56
+
57
+ The obligations each tier attaches are in `standards/policy/minsec.md`, which is
58
+ the canonical table. Read it rather than reciting from memory; it is cumulative
59
+ and people routinely forget that `low` has real requirements too.
60
+
61
+ Adding a form that collects personal information, an authentication flow, or a
62
+ payment processor is a **tier change**, not a feature. Flag it, name the new
63
+ obligations, and point at the Data Risk Assessment process. Do not quietly
64
+ implement it.
65
+
66
+ ## Report what you found
67
+
68
+ Keep it to a few lines. The person does not need their own project read back to
69
+ them.
70
+
71
+ ```
72
+ This is <recipe> at <tier> tier, standards v<n>.
73
+ Stack resolved: <the two or three that matter>.
74
+ <n> recorded divergences: <one-line summary>.
75
+ <n> acknowledged findings, <n> past review date.
76
+ ```
77
+
78
+ Then get on with the actual task.
79
+
80
+ ## If the manifest is stale
81
+
82
+ `sws doctor` compares the recorded standards version against what is installed.
83
+ When it is behind, say so once and offer `sws update` to show what changed.
84
+ **Never update without being asked.** A project pinned to older standards may be
85
+ mid-review, or may have shipped and be under change control.